2021-02-19 16:42:16 +00:00
|
|
|
import BaseAbility from './base';
|
|
|
|
|
|
|
|
export default class IntentionAbility extends BaseAbility {
|
|
|
|
resource = 'intention';
|
|
|
|
|
|
|
|
get canWrite() {
|
2022-07-26 16:29:37 +00:00
|
|
|
// Peered intentions aren't writable
|
|
|
|
if(typeof this.item !== 'undefined' && typeof this.item.SourcePeer !== 'undefined') {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return super.canWrite &&
|
|
|
|
(typeof this.item === 'undefined' || !this.canViewCRD);
|
2021-09-27 16:19:32 +00:00
|
|
|
}
|
|
|
|
get canViewCRD() {
|
|
|
|
return (typeof this.item !== 'undefined' && this.item.IsManagedByCRD);
|
2021-02-19 16:42:16 +00:00
|
|
|
}
|
|
|
|
}
|