kasvith / express-mongo-jwt-boilerplate

Express Mongo JsonWebToken boilerplate
103 stars 43 forks source link

[Discussion] Introducing a powerful role management system #28

Open kasvith opened 5 years ago

kasvith commented 5 years ago

Currently we don't have a role management system. We have admin and user. But that's not it.

While developing applications its often to have multiple roles and allow access based on roles. Roles does inherit properties like an admin can do what an editor can do for sure but not otherway around.

It would be better if we could introduce a nice role management system where users can add roles and manage roles

d0peCode commented 5 years ago

I think it's not a good idea to have everyone - editors, admins, users etc in one collection. They may have totally different fields in schema.

d0peCode commented 5 years ago

Maybe we should have collection of roles

kasvith commented 5 years ago

Yeah. That's true. They have different attributes. But we can keep the role in the same user collection and we can create a separate collection to hold role attributes.