2023-05-11 15:15:31 -07: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-05-11 15:15:31 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import ModelAbility from './model';
|
|
|
|
|
/**
|
|
|
|
|
* Provides abilities for auth method.
|
|
|
|
|
*/
|
|
|
|
|
export default class AuthMethodAbility extends ModelAbility {
|
|
|
|
|
// =permissions
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Only "known" auth method types may be read.
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canRead() {
|
|
|
|
|
return !this.model.isUnknown && this.hasAuthorizedAction('read');
|
|
|
|
|
}
|
2023-05-17 14:31:12 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Only "known" auth method types may be updated.
|
|
|
|
|
*/
|
|
|
|
|
get canUpdate() {
|
|
|
|
|
return !this.model.isUnknown && this.hasAuthorizedAction('update');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Only "known" auth method types may be deleted.
|
|
|
|
|
*/
|
|
|
|
|
get canDelete() {
|
|
|
|
|
return !this.model.isUnknown && this.hasAuthorizedAction('delete');
|
|
|
|
|
}
|
2023-05-11 15:15:31 -07:00
|
|
|
}
|