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

43 lines
813 B
JavaScript
Raw Normal View History

2021-09-16 14:49:48 -04:00
import ModelAbility from './model';
/**
2021-09-17 09:27:51 -04:00
* Provides a `connect` ability for targets.
2021-09-16 14:49:48 -04:00
*/
export default class TargetAbility extends ModelAbility {
// =permissions
/**
* @type {boolean}
*/
get canConnect() {
return this.hasAuthorizedAction('authorize-session');
}
2021-09-28 14:09:11 -04:00
/**
* @type {boolean}
*/
get canAddHostSources() {
return this.hasAuthorizedAction('add-host-sources');
}
/**
* @type {boolean}
*/
get canRemoveHostSources() {
return this.hasAuthorizedAction('remove-host-sources');
}
2021-09-28 14:09:11 -04:00
/**
* @type {boolean}
*/
get canAddCredentialSources() {
return this.hasAuthorizedAction('add-credential-sources');
}
/**
* @type {boolean}
*/
get canRemoveCredentialSources() {
return this.hasAuthorizedAction('remove-credential-sources');
}
2021-09-16 14:49:48 -04:00
}