From 26baf8a80bfa67dff269b6a2a53f58b2b2097478 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 20 Jun 2022 12:28:13 -0400 Subject: [PATCH] fix: grant scope field should be functional (#1147) --- addons/api/addon/models/role.js | 7 +++++++ ui/admin/app/components/form/role/index.hbs | 8 +++++--- ui/admin/app/components/form/role/index.js | 17 +++++------------ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/addons/api/addon/models/role.js b/addons/api/addon/models/role.js index 60edd5ac9..5abb8fd6c 100644 --- a/addons/api/addon/models/role.js +++ b/addons/api/addon/models/role.js @@ -23,6 +23,13 @@ export default class RoleModel extends GeneratedRoleModel { */ @array('string', { readOnly: true }) grant_strings; + /** + * Convenience for looking up the grant scope, if loaded. + */ + get grantScope() { + return this.store.peekRecord('scope', this.grant_scope_id); + } + // =methods /** diff --git a/ui/admin/app/components/form/role/index.hbs b/ui/admin/app/components/form/role/index.hbs index 4c82c77f0..5acbbb603 100644 --- a/ui/admin/app/components/form/role/index.hbs +++ b/ui/admin/app/components/form/role/index.hbs @@ -63,15 +63,16 @@ +
{{/unless}} {{#if (can 'save model' @model)}}