I'm modeling a MySQL database and it has a
users table with the columns:
The access crontrol will be made on programming level (NodeJS).
Each user may have a different combination of permissions to modules M#.
One user may have permissions to access M1, M2, and M3. another user may have permissions to access M2 and M4, and so on...
I would like to know what is the best way to store that kind of information.
I read a long time ago about the binary thing like:
000010001 - permitted access to M0 and M4
010000100 - permitted access to M2 and M7
000000011 - permitted access to M0 and M1
I am confused on how to store and retrieve that information. What datatype would be suitable for that purpose?