-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend: Make authorisation middleware for admin role #42
Comments
@anand-harsh i would like to work on this. kindly assign under JWOC |
@anand-harsh I would love to work on this issue under JWOC. Van you please assign this issue to me |
@anand-harsh /course/:id route is not defined |
In API (backend) |
@anand-harsh It should be get request rather than post? |
We are not making crud operation here so no need of post or get. We are making middleware which will be later used in get or post request routes to limit the access of normal user to that route. Here what you can do is, take token from cookie, decode that token to get id, check the role for that id, if the role of that id is admin, return next() else return ErrorHandler("cant access") with a status code. Hope you get it |
Issue
As anyone can add course to playlist or remove it from playlist, so we do not want this full authority to be given to users
Solution
The text was updated successfully, but these errors were encountered: