Files
threshold-ui/addons/api/addon/abilities/storage-bucket.js
T
2024-05-31 11:29:24 -07:00

40 lines
759 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import ModelAbility from './model';
/**
* Provides abilities for storage buckets.
*/
export default class StorageBucketAbility extends ModelAbility {
// =services
// =permissions
/**
* Only "known" storage bucket types may be read.
* @type {boolean}
*/
get canRead() {
return !this.model.isUnknown && super.canRead;
}
/**
* Only "known" storage bucket types may be updated.
* @type {boolean}
*/
get canUpdate() {
return !this.model.isUnknown && super.canUpdate;
}
/**
* Only "known" storage bucket types may be deleted.
* @type {boolean}
*/
get canDelete() {
return !this.model.isUnknown && super.canDelete;
}
}