Files
threshold-ui/ui/admin/app/abilities/session-recording.js
T
Zhihe Li d08ce29e5a Chore/update model names (#125)
* chore: 🤖 Rename recording to session-recording

* chore: 🤖 Update names for connection models

* chore: 🤖 Update channel models to new name

* chore: 🤖 Update remaining models after merge conflict
2023-03-16 13:49:04 -04:00

34 lines
948 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import SessionRecordingAbility from 'api/abilities/session-recording';
import { inject as service } from '@ember/service';
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('session-recording') ? super.canRead : false;
}
/**
* This override ensures that session recordings can only be presented in the global scope
* and if the session-recording feature flag is enabled. */
get canList() {
return this.features.isEnabled('session-recording')
? this.hasAuthorizedCollectionAction('list') && this.model.isGlobal
: false;
}
get canNavigate() {
return this.canList;
}
}