[BE] Fix 500 error when viewing Roles and Permissions page when not logged in
When trying to view the Roles and Permissions without logging in first, a 500 error is shown instead of a 404 Not Found or a redirect to the login page:
![]() |
This is because backend is checking if the user has permission to view the page, but with no user logged in, there's no user object to check against, and a NoMethodError
is thrown:
![]() |
What should happen
The user should either see a 404 Not Found page or be redirected to the login page, whichever is more appropriate.
Edited by Daniel Tian