Files
threshold-ui/addons/api/addon/abilities/account.js
T

44 lines
883 B
JavaScript
Raw Normal View History

/**
2026-01-28 17:09:06 -08:00
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
2021-09-29 17:47:48 -04:00
import ModelAbility from './model';
/**
* Provides abilities for accounts.
*/
export default class AccountAbility extends ModelAbility {
// =permissions
/**
* Only "known" account types may be read.
* @type {boolean}
*/
get canRead() {
return !this.model.isUnknown && this.hasAuthorizedAction('read');
}
/**
* Only "known" account types may be updated.
* @type {boolean}
*/
get canUpdate() {
return !this.model.isUnknown && this.hasAuthorizedAction('update');
}
/**
* Only "known" account types may be deleted.
* @type {boolean}
*/
get canDelete() {
return !this.model.isUnknown && this.hasAuthorizedAction('delete');
}
2021-09-29 17:47:48 -04:00
/**
* @type {boolean}
*/
get canSetPassword() {
return this.hasAuthorizedAction('set-password');
}
}