chore: 🤖 add attach and detach storage policy permissions (#2080)

* chore: 🤖 add attach and detach storage policy permissions
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2024-01-09 11:39:28 -08:00
1 parent 3810217ce7
commit 3f178363d9
6 files changed
+145

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import ModelAbility from './model';
/**
* Provides abilities for scopes.
*/
export default class ScopeAbility extends ModelAbility {
// =permissions
/**
* Permission that checks whether a policy can be attached to a scope
* @type {boolean}
*/
get canAttachStoragePolicy() {
return this.hasAuthorizedAction('attach-storage-policy');
}
/**
* Permission that checks whether a policy can be detached to a scope
* @type {boolean}
*/
get canDetachStoragePolicy() {
return this.hasAuthorizedAction('detach-storage-policy');
}
}