open-vault/ui/app/models/control-group.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

18 lines
666 B
JavaScript

import { alias } from '@ember/object/computed';
import DS from 'ember-data';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
const { attr, belongsTo, hasMany } = DS;
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: alias('authorizePath.canUpdate'),
configurePath: lazyCapabilities(apiPath`sys/config/control-group`),
canConfigure: alias('configurePath.canUpdate'),
});