e8593ec1bb
This rethinks namespaces as a filter on list pages rather than a global setting. The biggest net-new feature here is being able to select All (*) to list all jobs or CSI volumes across namespaces.
17 lines
537 B
JavaScript
17 lines
537 B
JavaScript
import AbstractAbility from './abstract';
|
|
import { computed, get } from '@ember/object';
|
|
import { or } from '@ember/object/computed';
|
|
|
|
export default class Allocation extends AbstractAbility {
|
|
@or('bypassAuthorization', 'selfTokenIsManagement', 'policiesSupportExec')
|
|
canExec;
|
|
|
|
@computed('rulesForNamespace.@each.capabilities')
|
|
get policiesSupportExec() {
|
|
return this.rulesForNamespace.some(rules => {
|
|
let capabilities = get(rules, 'Capabilities') || [];
|
|
return capabilities.includes('alloc-exec');
|
|
});
|
|
}
|
|
}
|