Ronald 9d21736e9f
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

22 lines
566 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import BaseAbility from './base';
export default class IntentionAbility extends BaseAbility {
resource = 'intention';
get canWrite() {
// 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);
}
get canViewCRD() {
return typeof this.item !== 'undefined' && this.item.IsManagedByCRD;
}
}