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

57 lines
1.1 KiB
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-16 14:49:48 -04:00
import ModelAbility from './model';
/**
2021-09-29 17:47:48 -04:00
* Provides abilities 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 canAddBrokeredCredentialSources() {
2021-09-28 14:09:11 -04:00
return this.hasAuthorizedAction('add-credential-sources');
}
/**
* @type {boolean}
*/
get canAddInjectedApplicationCredentialSources() {
return (
2025-06-20 09:52:22 -05:00
(this.model.isSSH || this.model.isRDP) &&
this.hasAuthorizedAction('add-credential-sources')
);
}
/**
* @type {boolean}
*/
get canRemoveCredentialSources() {
return this.hasAuthorizedAction('remove-credential-sources');
}
2021-09-16 14:49:48 -04:00
}