I have users for my application with access control list (these are both tables/schema/objects). Currently these are read from the database, Boolean values are used to indicate what they can view/manipulate. However, anyone can still go to the database and change the data. Can someone offer some suggestion on what kind of things I can do? I hope I am clear we have users (uname + pass) and acl (empui_access, empdat_manipulate). Any kinda security solutions via code etc…
I have users for my application with access control list (these are both tables/schema/objects).
Share
Something like
username is the username, password_hash is the hash of the password, with a grain of salt. It’s wrong to store a plain password, but you already knew that, didn’t you?
ACL is declared as a string but used as a bit array.
Each bit represents a certain permission. 1 means the user has the permission, 0 means he doesn’t. To check for a certain bit’s value, you do a bit-wise AND on the acl. If the result is non-zero, access is granted. If the result is zero, access is denied.
For example:
To add group support, add a couple tables.
And in addition to testing for the user-level permission, test the groups to which the user belongs. Of course, you’ll write some helper functions, maybe a stored procedure.
I hope this got you started. If not, I can give you a more descriptive example, or more actual code, or other help.