import { belongsTo, attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import IdentityModel from './_base';
import identityCapabilities from 'vault/macros/identity-capabilities';
export default IdentityModel.extend({
parentType: 'group',
formFields: computed(function () {
return ['name', 'mountAccessor'];
}),
group: belongsTo('identity/group', { readOnly: true, async: false }),
name: attr('string'),
canonicalId: attr('string'),
mountPath: attr('string', {
readOnly: true,
mountType: attr('string', {
mountAccessor: attr('string', {
label: 'Auth Backend',
editType: 'mountAccessor',
creationTime: attr('string', {
lastUpdateTime: attr('string', {
updatePath: identityCapabilities(),
canDelete: alias('updatePath.canDelete'),
canEdit: alias('updatePath.canUpdate'),
});