Files
threshold-ui/ui/admin/app/abilities/credential-library.js
T
Randall Morey acd719140d Refactor edition enablement (#1657)
* refactor: 💡 consolidate ssh features into ssh-target flag

✅ Closes: ICU-8383

* refactor: 💡 factor out base edition

* feat: 🎸 dynamic feature edition enablement and toggling
2023-03-17 14:34:37 -07:00

25 lines
685 B
JavaScript

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