vault/ui/app/models/identity/group-alias.js
Chelsea Shaw aa95f003a8
UI: Ember 5 deprecation stragglers (#26666)
* use router for transitions within replication engine

* fix inverse value on group-alias belongsTo relationship

* Always call super.willDestroy after custom hooks

* fix deprecation ember-engines.deprecation-camelized-engine-names

* graceful fallback on message-error if adapterError does not include errors

* use router.replaceWith during tests on logout

* fix more links
2024-04-30 11:22:08 -05:00

44 lines
1.1 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
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, inverse: 'alias' }),
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: alias('updatePath.canDelete'),
canEdit: alias('updatePath.canUpdate'),
});