feat: 🎸 add principals list tab

This commit is contained in:
Randall Morey committed 2020-08-12 13:41:23 -04:00
1 parent 4ce8f0aa99
commit 971e483d01
16 files changed
+201 -4

No files matched your search

@@ -0,0 +1,20 @@
import Fragment from 'ember-data-model-fragments/fragment';
import { attr } from '@ember-data/model';
export default class FragmentPrincipal extends Fragment {
// =attributes
@attr('string', {
description: 'ID of the related scope'
}) scope_id;
@attr('string', {
description: 'ID of the related principal (user or group)'
}) principal_id;
@attr('string', {
description: 'Type of the related principal (user or group)'
}) type;
}
+9
View File
@@ -5,6 +5,15 @@ export default class RoleModel extends GeneratedRoleModel {
// =attributes
/**
* Principals are users and groups assigned to a role. They are represented
* as references to User and Group instances. Since Ember Data relationships
* are wanting, we do not model these as a polymorphic relationship as might
* see obvious. Instead, the application layer is expected to load referenced
* users and groups as needed.
*/
@fragmentArray('fragment-principal', {readOnly: true}) principals;
/**
* Grants is read-only _most_ under normal circumstances. But grants can
* be persisted via a dedicated call to `saveGrants()`.