I’m creating an application in Java (& using Mysql as DBMS).
My app. has users and each user can be permitted or not permitted for each feature of app.
there are 8 different static permissions.
How can I store these permissions for each user?
Is it a good idea to store it like Unix file mode bits (e.g. 0775)?
Thanks
3 of the many many approaches:
1) database : define roles like admin, manager etc. so that they can have viewing, writing roles. the tables will contain the users and the roles assigned to them.
2) xml files for storing the names and the roles. (Tomcat is a good example. u can store the roles in conf.xml)
3) if u want to chuck out db and xml.. simple bit operations can also help u.
http://vipan.com/htdocs/bitwisehelp.html
this site explains how to use permissions using bit operations.