Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user permissions

Status
Not open for further replies.

sysadmin42

Technical User
May 6, 2005
138
I am about to create a new site with some pretty complex user permission work. Previously, I have simply had a table (MySQL) like this example:

id - autoindex
user_id - smallint, linked to the user table with their name and everything
permission_1 - enum(0,1)
permission_2 - enum(0,1)
etc...

then, at the beginning of the pages requiring permissions, just getting the value of the appropriate permission. 0=not allowed, 1=allowed. Also, say there is an office location table and you can let users only see certain offices' info:

allowed_locations - varchar(100) Example value: "1,4,8,9,10"

Is there a more better and/or efficient way to set up permissions in general?
 
Binary string

10110100101010010100100100100100010010001000

Then set constants to point to each element in the string, 0 = no, 1 = yes

We currently use this method to manage some 400 permissions for our application

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
how do you keep all the places straight and organized?
 
we use an include file and define the constants for each position

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top