Answer the question
In order to leave comments, you need to log in
Do roles need groups for roles?
Is it worth doing in a large project that will be broken into microservices in the future, groups for user roles, or is it better to leave the connection directly User->Role?
An example would be:
User->RoleGroups->Roles The
user belongs to the administrators and moderators groups, for example there will be forum moderators and chat moderators, like moderators, but different, but the group is one, moderator .
Answer the question
In order to leave comments, you need to log in
It is better to lay initially such an opportunity, you can look towards RBAC.
In my opinion, this User->RoleGroups->Roles is not a very good implementation.
Better to do something like User->Role->Permission, ie:
User - user
Role - role (administrator, moderator)
Permission - access level (editing, deleting, etc.).
But the Role must be in a hierarchy, for example admin -> moderator -> user -> guest, where:
- Guest view posts
- User can create, edit his post
- Moderator can create, edit all posts
- Admin can create, edit and delete all posts
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question