Improve robustness of admin role checks #32

Open
opened 2024-01-21 04:32:14 +01:00 by MoralCode · 0 comments
Owner

Currently whether the user is an admin is determined by the string name of their role. This is reasonably secure since these are created in Auth0 by the super admin, so it would be very hard for an attacker to somehow mess with that, however, this should Ideally not be done this way because it is certifiably jank ™️.

a better way may be to have the super admin provide the Role ID values from auth0 as an environment variable to be used for comparisons. i.e. there could be env vars such as CLASSCLOCK_SUPERADMIN_ROLE_ID and CLASSCLOCK_SCHOOL_ADMIN_ROLE_ID. This would allow for future UI's to be created for the superadmin to be able to assign admins to schools on their instance and may be required for an open source release

Currently whether the user is an admin is determined by the string name of their role. This is reasonably secure since these are created in Auth0 by the super admin, so it would be very hard for an attacker to somehow mess with that, however, this should Ideally not be done this way because it is certifiably jank :tm:. a better way may be to have the super admin provide the `Role ID` values from auth0 as an environment variable to be used for comparisons. i.e. there could be env vars such as `CLASSCLOCK_SUPERADMIN_ROLE_ID` and `CLASSCLOCK_SCHOOL_ADMIN_ROLE_ID`. This would allow for future UI's to be created for the superadmin to be able to assign admins to schools on their instance and may be required for an open source release
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ClassClock/API#32
No description provided.