2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
*/
|
|
|
|
|
|
2022-08-01 16:04:41 -04:00
|
|
|
import ModelAbility from './model';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Provides abilities for workers.
|
|
|
|
|
*/
|
|
|
|
|
export default class WorkerAbility extends ModelAbility {
|
|
|
|
|
// =permissions
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canCreateWorkerLed() {
|
|
|
|
|
return this.hasAuthorizedCollectionAction('create:worker-led');
|
|
|
|
|
}
|
2024-07-09 15:10:30 -05:00
|
|
|
|
2024-07-12 13:31:42 -05:00
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
2024-07-09 15:10:30 -05:00
|
|
|
get canSetWorkerTags() {
|
|
|
|
|
return this.hasAuthorizedAction('set-worker-tags');
|
|
|
|
|
}
|
2024-07-12 13:31:42 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get canRemoveTags() {
|
|
|
|
|
return this.hasAuthorizedAction('remove-worker-tags');
|
|
|
|
|
}
|
2022-08-01 16:04:41 -04:00
|
|
|
}
|