Answer the question
In order to leave comments, you need to log in
How to make roles for nodejs users?
I’m just starting to learn express, nodejs, and I don’t know how best to create roles for users, I want to do something like on upwork, that is, a client or a freelancer, the client has one interface, the freelancer has another. Maybe there are some tutorials on this topic or your repositories with a similar implementation, if it's not difficult to share :)
Answer the question
In order to leave comments, you need to log in
In the settings of a specific user, save the sign of his role, and in the middleware check this sign for the current authorized user and change the output for different roles
Here are two examples
https://www.npmjs.com/package/express-roles
https://gist.github .com/joshnuss/37ebaf958fe65a18d4ff
I think here it is necessary to use middleware
In general, the implementation of roles and rights is not tied to a language or a framework. She is the same everywhere. Look at the packages for the same Laravel and migrate. Or find Express-ready
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question