fix: 🐛 delete and retain_until should be readonly and Scope level policies (#2104)
* fix: 🐛 delete and retain_until should be readonly * fix: 🐛 global scope should have policies from self and orgs
This commit is contained in:
1 parent
3f4beaada8
commit
db50bfc9df
2 files changed
+14
-4
No files matched your search
@@ -22,13 +22,21 @@ export default class ScopesScopeAddStoragePolicyIndexRoute extends Route {
|
||||
*/
|
||||
async afterModel() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
|
||||
//fetch policies from current scope
|
||||
const orgScopePolicies = await this.store.query('policy', {
|
||||
const currentScopePolicies = await this.store.query('policy', {
|
||||
scope_id,
|
||||
});
|
||||
|
||||
this.policyList = orgScopePolicies;
|
||||
if (scope_id === 'global') {
|
||||
// Global scope should only list policies from its scope
|
||||
this.policyList = currentScopePolicies;
|
||||
} else {
|
||||
// Org scope should list both global and org scope policies
|
||||
const globalScopePolicies = await this.store.query('policy', {
|
||||
scope_id: 'global',
|
||||
});
|
||||
|
||||
this.policyList = [...globalScopePolicies, ...currentScopePolicies];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user