This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.
User Role #42
Open
Description
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 beid
. Butcreated_at
andupdated_at
fields are not necessary). This enum should have two entries for now -Candidate
andAdmin
. - A user should be able to have many roles.
- Make sure that user will have a
Candidate
role when the user registers throughapi/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
)
Metadata
Metadata
Assignees
Labels
No labels