github.com/hernad/nomad@v1.6.112/ui/app/abilities/allocation.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import AbstractAbility from './abstract';
     7  import { computed, get } from '@ember/object';
     8  import { or } from '@ember/object/computed';
     9  
    10  export default class Allocation extends AbstractAbility {
    11    @or('bypassAuthorization', 'selfTokenIsManagement', 'policiesSupportExec')
    12    canExec;
    13  
    14    @computed('rulesForNamespace.@each.capabilities')
    15    get policiesSupportExec() {
    16      return this.rulesForNamespace.some((rules) => {
    17        let capabilities = get(rules, 'Capabilities') || [];
    18        return capabilities.includes('alloc-exec');
    19      });
    20    }
    21  }