This change includes making static type credential stores clickable when
listing all credential stores, along with view the individual credential
store.
✅ Closes: ICU-5173
23 lines
539 B
JavaScript
23 lines
539 B
JavaScript
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');
|
|
}
|
|
}
|