2023-03-15 15:45:51 -04:00
|
|
|
/**
|
2026-01-28 17:09:06 -08:00
|
|
|
* Copyright IBM Corp. 2021, 2026
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-15 15:45:51 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import ModelAbility from './model';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Provides abilities for session recordings.
|
|
|
|
|
*/
|
2023-03-16 13:49:04 -04:00
|
|
|
export default class SessionRecordingAbility extends ModelAbility {
|
2023-03-15 15:45:51 -04:00
|
|
|
// =services
|
|
|
|
|
|
|
|
|
|
// =permissions
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Only "known" session recording types may be read.
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canRead() {
|
2023-05-17 12:24:31 -07:00
|
|
|
return !this.model.isUnknown && super.canRead;
|
2023-03-15 15:45:51 -04:00
|
|
|
}
|
|
|
|
|
|
2024-02-13 13:26:23 -08:00
|
|
|
/**
|
|
|
|
|
* Only "known" session recording types may be deleted.
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canDelete() {
|
|
|
|
|
return !this.model.isUnknown && super.canDelete && this.model.isAvailable;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-31 17:19:46 -04:00
|
|
|
get canDownload() {
|
2023-04-03 11:56:05 -04:00
|
|
|
return this.hasAuthorizedAction('download');
|
2023-03-15 15:45:51 -04:00
|
|
|
}
|
2024-01-17 11:37:54 -08:00
|
|
|
|
|
|
|
|
/* Permission that checks whether a policy can be reapplied to a session recording
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canReapplyStoragePolicy() {
|
|
|
|
|
return this.hasAuthorizedAction('reapply-storage-policy');
|
|
|
|
|
}
|
2023-03-15 15:45:51 -04:00
|
|
|
}
|