Refactor account and user abilities (#1694)

* refactor: 💡 add abilities to user and remove from account
This commit is contained in:
lisbet-alvarez authored and GitHub committed 2023-05-22 11:16:48 -07:00
1 parent fe81a626fa
commit 379f317d8b
5 files changed
+269 -102

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import UserAbility from 'api/abilities/user';
import { inject as service } from '@ember/service';
export default class OverrideUserAbility extends UserAbility {
// =service
@service features;
/**
* These override abilities are temporary and just part of Phase 1
* of LDAP auth method implementation.
*/
get canAddAccount() {
return this.features.isEnabled('ldap-auth-methods') || !this.account.isLDAP
? super.canAddAccount
: false;
}
get canRemoveAccount() {
return this.features.isEnabled('ldap-auth-methods') || !this.account.isLDAP
? super.canRemoveAccount
: false;
}
}