Files
threshold-ui/ui/admin/app/abilities/session-recording.js
T

42 lines
1.1 KiB
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
2023-03-16 13:49:04 -04:00
import SessionRecordingAbility from 'api/abilities/session-recording';
import { inject as service } from '@ember/service';
2023-03-16 13:49:04 -04:00
export default class OverrideSessionRecordingAbility extends SessionRecordingAbility {
// =service
@service features;
/**
* This override ensures that session recordings may be read only if the
* session-recording feature flag is enabled.
*/
get canRead() {
return this.features.isEnabled('ssh-session-recording')
? super.canRead
: false;
}
/**
* Reapplying policy is allowed only if the feature flag is enabled
* @type {boolean}
*/
get canReapplyStoragePolicy() {
return this.features.isEnabled('ssh-session-recording')
? this.hasAuthorizedAction('reapply-storage-policy')
: false;
}
2024-02-13 13:26:23 -08:00
/**
* This override ensures that session recordings may be deleted only if the
* session-recording feature flag is enabled.
*/
get canDelete() {
return this.features.isEnabled('ssh-session-recording')
? super.canDelete
: false;
}
}