open-vault/ui/app/models/identity/entity-alias.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

42 lines
1 KiB
JavaScript

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