Skip to content

Fix role creation leaving new roles with zero permissions - #18

Open
ShowMeMyCent wants to merge 1 commit into
Daskom-Lab:mainfrom
ShowMeMyCent:fix/roles
Open

Fix role creation leaving new roles with zero permissions#18
ShowMeMyCent wants to merge 1 commit into
Daskom-Lab:mainfrom
ShowMeMyCent:fix/roles

Conversation

@ShowMeMyCent

Copy link
Copy Markdown
Contributor

RoleController::store had three stacked bugs that combined to make role creation silently non-functional:

  • The 'super' and 'aslab' package cases were commented out in the switch statement, falling through to a default branch that reset the whole permissions accumulator to empty.
  • No package guaranteed manage-profile/lms-configuration, the only permissions accepted by the /assistant route every asisten lands on after login, so roles without asisten or aslab checked could log in but were immediately blocked.
  • PermissionGroupEnum::ASISTEN (the default, pre-checked package) referenced see-modul, a permission never seeded into the database and checked by no route. syncPermissions() throws on unresolvable names before writing anything, so any role including the default package ended up with zero permissions regardless of the fixes above. Removed the dead see-modul entry; ImportSqlDump.php already worked around this same bug locally, so simplified it to match.

Also gate Reverb/Echo initialization on VITE_REVERB_APP_KEY being configured, since local dev without a running Reverb server was spamming failed websocket reconnect attempts. Removed echo.js, a dead duplicate of the same unconditional Echo instantiation.

RoleController::store had three stacked bugs that combined to make
role creation silently non-functional:

- The 'super' and 'aslab' package cases were commented out in the
  switch statement, falling through to a default branch that reset
  the whole permissions accumulator to empty.
- No package guaranteed manage-profile/lms-configuration, the only
  permissions accepted by the /assistant route every asisten lands
  on after login, so roles without asisten or aslab checked could
  log in but were immediately blocked.
- PermissionGroupEnum::ASISTEN (the default, pre-checked package)
  referenced see-modul, a permission never seeded into the database
  and checked by no route. syncPermissions() throws on unresolvable
  names before writing anything, so any role including the default
  package ended up with zero permissions regardless of the fixes
  above. Removed the dead see-modul entry; ImportSqlDump.php already
  worked around this same bug locally, so simplified it to match.

Also gate Reverb/Echo initialization on VITE_REVERB_APP_KEY being
configured, since local dev without a running Reverb server was
spamming failed websocket reconnect attempts. Removed echo.js, a
dead duplicate of the same unconditional Echo instantiation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant