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-27 16:55:19 -04:00
|
|
|
|
2021-09-28 14:09:11 -04:00
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canAddHostSources() {
|
|
|
|
|
return this.hasAuthorizedAction('add-host-sources');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-27 16:55:19 -04:00
|
|
|
/**
|
|
|
|
|
* @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');
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-27 16:55:19 -04:00
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canRemoveCredentialSources() {
|
|
|
|
|
return this.hasAuthorizedAction('remove-credential-sources');
|
|
|
|
|
}
|
2021-09-16 14:49:48 -04:00
|
|
|
}
|