2023-05-11 15:15:31 -07:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-05-11 15:15:31 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import AuthMethodAbility from 'api/abilities/auth-method';
|
2023-05-17 14:31:12 -07:00
|
|
|
import { inject as service } from '@ember/service';
|
2023-05-11 15:15:31 -07:00
|
|
|
|
|
|
|
|
export default class OverrideAuthMethodAbility extends AuthMethodAbility {
|
2023-05-17 14:31:12 -07:00
|
|
|
//service
|
|
|
|
|
@service features;
|
|
|
|
|
|
2023-05-11 15:15:31 -07:00
|
|
|
/**
|
|
|
|
|
* These override abilities are temporary and just part of Phase 1
|
|
|
|
|
* of LDAP auth method implementation.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
get canRead() {
|
2023-05-17 14:31:12 -07:00
|
|
|
return this.features.isEnabled('ldap-auth-methods') || !this.model.isLDAP
|
|
|
|
|
? super.canRead
|
|
|
|
|
: false;
|
2023-05-11 15:15:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get canMakePrimary() {
|
2023-05-17 14:31:12 -07:00
|
|
|
return this.features.isEnabled('ldap-auth-methods') || !this.model.isLDAP;
|
2023-05-11 15:15:31 -07:00
|
|
|
}
|
|
|
|
|
}
|