open-vault/ui/app/models/control-group.js
Matthew Irish 9953eb76aa
UI - control groups (#4947)
* add routes for control groups in tools, settings, access (#4718)
* UI control group - storage, request, authorization, and unwrapping (#4899)
* UI control groups config (#4927)
2018-07-18 20:59:04 -05:00

19 lines
691 B
JavaScript

import Ember from 'ember';
import DS from 'ember-data';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
const { attr, belongsTo, hasMany } = DS;
const { computed } = Ember;
export default DS.Model.extend({
approved: attr('boolean'),
requestPath: attr('string'),
requestEntity: belongsTo('identity/entity', { async: false }),
authorizations: hasMany('identity/entity', { async: false }),
authorizePath: lazyCapabilities(apiPath`sys/control-group/authorize`),
canAuthorize: computed.alias('authorizePath.canUpdate'),
configurePath: lazyCapabilities(apiPath`sys/config/control-group`),
canConfigure: computed.alias('configurePath.canUpdate'),
});