Load role permissions when opening the Edit Role dialog #17

Merged
padreug merged 2 commits from fix/edit-role-permissions-loading into main 2026-05-17 12:56:07 +00:00

2 commits

Author SHA1 Message Date
1edd126a43 Reset role permission/user state when closing the role dialog
closeViewRoleDialog already clears rolePermissionsForView and
roleUsersForView; closeRoleDialog (used by both Edit and Create flows)
did not. With editRole now populating those arrays, leftover state
would otherwise survive a close → open-Create round trip. The Create
template branch doesn't read the arrays today (v-if guarded on
editingRole), so this is defensive — keeps the two close handlers
symmetrical and avoids future regressions if the Create branch ever
starts referencing them.
2026-05-17 13:52:50 +02:00
55f8249f2c Load role permissions when opening the Edit Role dialog
The dialog reads from rolePermissionsForView / roleUsersForView, but
editRole(role) only ever populated the form fields and showed the
dialog — those arrays were left at whatever state the rest of the page
had set them to. Result: opening Edit Role for a role with existing
permissions showed "No permissions assigned to this role yet", and the
list only "appeared" because adding a permission triggered a refresh.

Mirror viewRole's pattern: clear both arrays, GET /admin/roles/{id},
populate from the response, then show the dialog after $nextTick.

Closes #14
2026-05-17 13:52:36 +02:00