You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 27, 2021. It is now read-only.
Is your feature request related to a problem? Please describe.
A user should be able to have different roles(Admin, Candidate, ContestManager, ...etc). Right now there is no way to assign a role to the user.
Describe the solution you'd like
Create a separate model as Role.
Role will only have one field value which is of type enum(There will also be id. But created_at and updated_at fields are not necessary). This enum should have two entries for now - Candidate and Admin.
A user should be able to have many roles.
Make sure that user will have a Candidate role when the user registers through api/register route.
Add a separate api to add a role to the user (POST /api/users/:id/roles).
Add a separate api to remove a role from the user. (DELETE /api/users/:id/roles/:role_id)