Files
threshold-ui/ui/admin/app/abilities/credential.js
T
hashicorp-copywrite[bot]andCameron Perera 3d610427d0 [COMPLIANCE] Add Copyright and License Headers (#1617)
* [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>
2023-03-01 09:39:41 -06:00

24 lines
650 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import CredentialAbility from 'api/abilities/credential';
import { inject as service } from '@ember/service';
export default class OverrideCredentialAbility extends CredentialAbility {
// =service
@service features;
/**
* This override ensures that JSON credentials may be read only if the
* json-credentials feature flag is enabled. All other types are subject
* to the standard logic found in the api addon.
*/
get canRead() {
return this.features.isEnabled('json-credentials') || !this.model.isJSON
? super.canRead
: false;
}
}