2018-09-25 16:28:26 +00:00
|
|
|
import { computed } from '@ember/object';
|
|
|
|
import { alias } from '@ember/object/computed';
|
2018-04-03 14:16:57 +00:00
|
|
|
import IdentityModel from './_base';
|
|
|
|
import DS from 'ember-data';
|
2018-05-24 03:10:21 +00:00
|
|
|
import identityCapabilities from 'vault/macros/identity-capabilities';
|
2018-04-03 14:16:57 +00:00
|
|
|
const { attr, belongsTo } = DS;
|
|
|
|
|
|
|
|
export default IdentityModel.extend({
|
2018-05-24 03:10:21 +00:00
|
|
|
parentType: 'entity',
|
2018-09-25 16:28:26 +00:00
|
|
|
formFields: computed(function() {
|
|
|
|
return ['name', 'mountAccessor'];
|
|
|
|
}),
|
2018-04-03 14:16:57 +00:00
|
|
|
entity: belongsTo('identity/entity', { readOnly: true, async: false }),
|
|
|
|
|
|
|
|
name: attr('string'),
|
|
|
|
canonicalId: attr('string'),
|
|
|
|
mountAccessor: attr('string', {
|
|
|
|
label: 'Auth Backend',
|
|
|
|
editType: 'mountAccessor',
|
|
|
|
}),
|
2018-05-24 03:10:21 +00:00
|
|
|
metadata: attr({
|
2018-04-03 14:16:57 +00:00
|
|
|
editType: 'kv',
|
|
|
|
}),
|
|
|
|
mountPath: attr('string', {
|
|
|
|
readOnly: true,
|
|
|
|
}),
|
|
|
|
mountType: attr('string', {
|
|
|
|
readOnly: true,
|
|
|
|
}),
|
|
|
|
creationTime: attr('string', {
|
|
|
|
readOnly: true,
|
|
|
|
}),
|
|
|
|
lastUpdateTime: attr('string', {
|
|
|
|
readOnly: true,
|
|
|
|
}),
|
|
|
|
mergedFromCanonicalIds: attr(),
|
2018-05-24 03:10:21 +00:00
|
|
|
|
|
|
|
updatePath: identityCapabilities(),
|
2018-09-25 16:28:26 +00:00
|
|
|
canDelete: alias('updatePath.canDelete'),
|
|
|
|
canEdit: alias('updatePath.canUpdate'),
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|