Custom roles not loaded in AuthContext causing permission checks to fail #10475
Unanswered
RBurns-CMG
asked this question in
Troubleshooting
Replies: 1 comment
-
|
Custom roles are not yet officially implemented |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Users with custom roles cannot access features even when their role has the correct permissions configured in the database. Only the two built-in system roles (USER and ADMIN) work correctly.
The AuthContext only loads the USER and ADMIN system roles into its roles object. When the useHasAccess hook checks permissions for a user with a custom role, it looks up that role in the roles object and gets undefined, causing all permission checks to fail.
This affects any feature that uses permission checks, including but not limited to the Agents endpoint visibility.
Version Information
Steps to Reproduce
What browsers are you seeing the problem on?
All browsers
Relevant log output
The roles object in AuthContext only contains USER and ADMIN entries. When a user has a custom role, the permission check fails because the custom role data is not loaded.
Beta Was this translation helpful? Give feedback.
All reactions