I started using the MVC pattern six months ago, and I still have some misunderstandings.
Now I want to implement role-based access control in my application. However, my question is not about RBAC, but about MVC.
My RBAC implementation is as follows: user-> role-based> Permission therefore each user (e.g. userA) can have many roles (e.g. reader, editor, admin), and each role can have many permissions (read, update, delete, etc. .).
MySQL Tables
- users (user list)
- roles (list of roles)
- permissions (list of permissions)
- role_permissions (list of roles-> connection permissions. ex. editor-> update)
- users_roles (list of users β connection roles. ex. userA-> editor)
Now my question is How to implement this in MVC? Do you have a separate model for: users, roles, permissions, role_permissions, users_roles than the authManager class that creates users, roles, permissions, role_permissions and user_roles? Is it correct? Is there a better, maybe more elegant way?
TamΓ‘s pap
source share