refactor: 💡 add global settings link (#2093)

refactor: 💡 add global settings link (#2093)
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2024-01-17 08:37:09 -08:00
1 parent c48fdb2017
commit 9e0467cbf0
7 files changed
+112 -23

No files matched your search

+14 -9
View File
@@ -11,15 +11,20 @@ import generateId from '../helpers/id';
export default factory.extend({
type: 'global',
authorized_actions: () =>
permissions.authorizedActionsFor('scope') || [
'no-op',
'read',
'update',
'delete',
'attach-storage-policy',
'detach-storage-policy',
],
authorized_actions() {
const authorizedActions = ['no-op', 'read', 'update'];
// Storage policies can only be attatched to global and org scopes.
if (this.type === 'global' || this.type === 'org') {
authorizedActions.push('attach-storage-policy', 'detach-storage-policy');
}
if (this.type === 'org' || this.type === 'project') {
authorizedActions.push('delete');
}
return permissions.authorizedActionsFor('scope') || authorizedActions;
},
authorized_collection_actions() {
const collectionActions = {