I'm trying to figure out how to work with filters for the following situation.
Lets say I have 3 different resources being handled as controllers such as the UsersController, GraphsController, MessagesController.
I also have 4 types of roles for users. These are: basic user, editor, administrator, site owner. A user can only have 1 type of role at any given time. I've made the relationships in my models correctly. I will include the tables included below.
Lets say all users can access the messages controller and only the site owner can access the graphs controller and only the site owner and administrator can access the users controller.
How could I take care of this in the filter the easiest based on the user's role.
Table: users
id name role_id
1 User 1 1
2 User 2 4
3 User 3 2
Table: roles
id role_name
1 Basic User
2 Editor
3 Administrator
4 Site Owner