2020-10-29 12:46:42 +00:00
|
|
|
import AbstractAbility from './abstract';
|
|
|
|
import { computed } from '@ember/object';
|
2020-11-06 14:21:38 +00:00
|
|
|
import { and, or } from '@ember/object/computed';
|
2020-10-29 12:46:42 +00:00
|
|
|
|
|
|
|
export default class Recommendation extends AbstractAbility {
|
2020-11-06 14:21:38 +00:00
|
|
|
@and('dynamicApplicationSizingIsPresent', 'hasPermissions')
|
2020-10-29 12:46:42 +00:00
|
|
|
canAccept;
|
|
|
|
|
2020-11-06 14:21:38 +00:00
|
|
|
@or('bypassAuthorization', 'selfTokenIsManagement', 'policiesSupportAcceptingOnAnyNamespace')
|
|
|
|
hasPermissions;
|
|
|
|
|
2020-10-29 12:46:42 +00:00
|
|
|
@computed('capabilitiesForAllNamespaces.[]')
|
|
|
|
get policiesSupportAcceptingOnAnyNamespace() {
|
|
|
|
return this.capabilitiesForAllNamespaces.includes('submit-job');
|
|
|
|
}
|
2020-11-06 14:21:38 +00:00
|
|
|
|
|
|
|
@computed('features.[]')
|
|
|
|
get dynamicApplicationSizingIsPresent() {
|
|
|
|
return this.featureIsPresent('Dynamic Application Sizing');
|
|
|
|
}
|
2020-10-29 12:46:42 +00:00
|
|
|
}
|