2021-02-19 16:42:16 +00:00
|
|
|
import BaseAbility from './base';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
|
|
|
|
export default class NspaceAbility extends BaseAbility {
|
|
|
|
@service('env') env;
|
|
|
|
|
|
|
|
resource = 'operator';
|
|
|
|
segmented = false;
|
|
|
|
|
|
|
|
get canManage() {
|
|
|
|
return this.canCreate;
|
|
|
|
}
|
|
|
|
|
2021-03-11 09:29:11 +00:00
|
|
|
get canDelete() {
|
|
|
|
return this.item.Name !== 'default' && super.canDelete;
|
|
|
|
}
|
|
|
|
|
2021-02-19 16:42:16 +00:00
|
|
|
get canChoose() {
|
|
|
|
return this.env.var('CONSUL_NSPACES_ENABLED') && this.nspaces.length > 0;
|
|
|
|
}
|
|
|
|
}
|