2021-10-01 17:22:50 -04:00
|
|
|
import ModelAbility from './model';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Provides abilities for host sets.
|
|
|
|
|
*/
|
2022-11-09 14:22:28 -06:00
|
|
|
export default class HostSetAbility extends ModelAbility {
|
2021-10-01 17:22:50 -04:00
|
|
|
// =permissions
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canAddHosts() {
|
|
|
|
|
return this.hasAuthorizedAction('add-hosts');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canRemoveHosts() {
|
|
|
|
|
return this.hasAuthorizedAction('remove-hosts');
|
|
|
|
|
}
|
2022-11-09 14:22:28 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canRead() {
|
|
|
|
|
return !this.model.isUnknown && this.hasAuthorizedAction('read');
|
|
|
|
|
}
|
2021-10-01 17:22:50 -04:00
|
|
|
}
|