* [COMPLIANCE] Add Copyright and License Headers * chore: 🤖 update Copyright headers to satisfy our lint rules --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
28 lines
617 B
JavaScript
28 lines
617 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import ModelAbility from './model';
|
|
import { inject as service } from '@ember/service';
|
|
/**
|
|
* Provides abilities for credential store.
|
|
*/
|
|
export default class CredentialStoreAbility extends ModelAbility {
|
|
// =services
|
|
|
|
@service features;
|
|
|
|
// =permissions
|
|
|
|
/**
|
|
* Only "known" credential store types may be read.
|
|
* @type {boolean}
|
|
*/
|
|
get canRead() {
|
|
return this.features.isEnabled('static-credentials')
|
|
? this.hasAuthorizedAction('read')
|
|
: !this.model.isStatic && this.hasAuthorizedAction('read');
|
|
}
|
|
}
|