2018-09-25 16:28:26 +00:00
|
|
|
import { alias } from '@ember/object/computed';
|
2018-07-19 01:59:04 +00:00
|
|
|
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`),
|
2018-09-25 16:28:26 +00:00
|
|
|
canAuthorize: alias('authorizePath.canUpdate'),
|
2018-07-19 01:59:04 +00:00
|
|
|
configurePath: lazyCapabilities(apiPath`sys/config/control-group`),
|
2018-09-25 16:28:26 +00:00
|
|
|
canConfigure: alias('configurePath.canUpdate'),
|
2018-07-19 01:59:04 +00:00
|
|
|
});
|