open-vault/ui/app/models/identity/group-alias.js

39 lines
935 B
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
import IdentityModel from './_base';
import DS from 'ember-data';
import Ember from 'ember';
import identityCapabilities from 'vault/macros/identity-capabilities';
2018-04-03 14:16:57 +00:00
const { attr, belongsTo } = DS;
const { computed } = Ember;
2018-04-03 14:16:57 +00:00
export default IdentityModel.extend({
parentType: 'group',
2018-04-03 14:16:57 +00:00
formFields: ['name', 'mountAccessor'],
group: belongsTo('identity/group', { readOnly: true, async: false }),
name: attr('string'),
canonicalId: attr('string'),
mountPath: attr('string', {
readOnly: true,
}),
mountType: attr('string', {
readOnly: true,
}),
mountAccessor: attr('string', {
label: 'Auth Backend',
editType: 'mountAccessor',
}),
creationTime: attr('string', {
readOnly: true,
}),
lastUpdateTime: attr('string', {
readOnly: true,
}),
updatePath: identityCapabilities(),
canDelete: computed.alias('updatePath.canDelete'),
canEdit: computed.alias('updatePath.canUpdate'),
2018-04-03 14:16:57 +00:00
});