Skip to content

Commit

Permalink
Fix contextual role editing in Admin Area
Browse files Browse the repository at this point in the history
  • Loading branch information
Fajfa committed Dec 2, 2024
1 parent 9f3c500 commit 483e934
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions client/web/admin/src/components/Role/CRoleEditorInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ export default {
},
set (isContext) {
this.role.meta.context.resourceTypes = []
this.role.meta.context.expr = ''
this.$emit('update:is-context', isContext)
},
},
Expand Down
2 changes: 1 addition & 1 deletion client/web/admin/src/views/System/Role/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default {
if (this.roleID) {
this.$SystemAPI.roleUpdate(role)
.then(role => {
.then(() => {
this.fetchRole()
this.animateSuccess('info')
Expand Down
2 changes: 1 addition & 1 deletion lib/js/src/system/types/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class Role {
}

get isContext (): boolean {
return this.meta?.context?.expr?.length > 0
return this.meta?.context?.expr?.length > 0 || this.meta?.context?.resourceTypes?.length > 0
}

clone (): Role {
Expand Down

0 comments on commit 483e934

Please sign in to comment.