Use RBAC for access rights and roles. You have a table "user"
with records of all users. And standard table RBAC "auth_assignment"
assign roles to each user
. In this case, there are several roles: admin, user, director, superadmin.
In some tables the GridView, when you query from the database, I want to display from the database of all user
which has the role user
. How it can be done in queries? Yet I see it like this:
- Looking for all user in the table "auth_assignment" who have the role user and get the user_id of all user s
- Looking for all user whose id is equal to user_id from the previous paragraph and send it all in GridView
I think this is all very difficult. Is there a more simple solution or write more optimal use. Thank you!