I save the Users list in a table. The business logic of the application will have a link to the object with all the data in this table for the current user. And to be able to allow the user to perform operations if they have the correct access.
I am wondering what is the best way to store "access levels"?
One of the ways I'm going to save the access level is an integer, and is using the C # flags to combine multiple access levels that don't require a bunch of fields a wise thing?
Create = 1 Read = 2 Update = 4 Delete = 8 FullAcc = 16
Another option that I think of feels less elegant, but I saw how he did a lot:
Read/Write = 1 R/W + Delete= 2 Full Access = 3
The reason I'm curious is because it would be easier to add extra elements to the second method, but at some point it will become a pain in the ass. What are your thoughts?
Nate
source share