So I have an application that has several modules (think of modules as different pages), each module has a set of permissions; view, add, edit, delete
I want each user role to have privileges for each module, for example
Role A Permissions
Module 1 -> view
Module 2 -> add, edit
Module 3 -> view, add, edit, delete
etc.
How can I design the database to support that and how would I go about implementing it using bitwise operators (or would there be a more efficient way for this particular case?)
I already have the user, user_role and role tables but I'm unsure on how to design the Module table.