feat: storage policies list view (#2071)

policies list view
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2024-01-08 15:12:49 -08:00
1 parent b3abb658ab
commit b79eebf73a
14 files changed
+538 -6

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import ModelAbility from './model';
import { service } from '@ember/service';
/**
* Provides abilities for storage policies.
*/
export default class PolicyAbility extends ModelAbility {
// =services
@service features;
// =permissions
/**
* This ensures that storage policies may be read only if the
* session-recording feature flag is enabled.
*/
get canRead() {
return this.features.isEnabled('ssh-session-recording')
? super.canRead
: false;
}
/**
* This ensures that storage policies may be updated only if the
* session-recording feature flag is enabled.
*/
get canUpdate() {
return this.features.isEnabled('ssh-session-recording')
? super.canUpdate
: false;
}
/**
* This ensures that storage policies may be deleted only if the
* session-recording feature flag is enabled.
*/
get canDelete() {
return this.features.isEnabled('ssh-session-recording')
? super.canDelete
: false;
}
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
export { default } from 'api/abilities/policy';
+2 -2
View File
@@ -22,12 +22,12 @@ export default factory.extend({
attributes() {
return {
retain_for: {
days: faker.number.int({ min: 10, max: 700 }),
days: faker.number.int({ min: 10, max: 100 }),
overridable: faker.datatype.boolean(),
},
delete_after: {
days: faker.number.int({ min: 1, max: 500 }),
days: faker.number.int({ min: 101, max: 500 }),
overridable: faker.datatype.boolean(),
},
};