Edit Role dialog shows "No permissions assigned" on open when role has existing permissions #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Opening the Edit Role dialog for a role that already has permissions assigned shows "No permissions assigned to this role yet" — the existing permissions only appear after a permission is added (or the dialog is closed and reopened after a refresh elsewhere).
Reproduction
Submit Expenseon Expenses).+button — both the new permission and the previously hidden ones appear.Likely Cause
The
editRole(...)handler instatic/js/permissions.jsinitializes the form fields (roleForm.name,description,is_default) but doesn't populate the role's permission list into the dialog's local state. The list state is only refreshed as a side effect of an add operation.Suggested Fix
When opening Edit Role, call the same loader that the View Role dialog uses (
loadRolePermissions(role.id)/rolePermissionsForView) so the existing permissions are visible immediately. Likely a few-line change in the open handler.Severity
Cosmetic/UX — no data is lost, but the dialog is misleading and the user can't manage existing permissions without first triggering an add to reveal them.