Morgoth
08-19-2003, 03:47 AM
First off, on my site, I wanted a good method so that the staff members on the site have specific access to what I tell them to have.
I was first thinking of just a simple field beside their account name in the database that gave them a rank.
Example:
0 - No Privileges
1 - Poll Privileges
2 - Posting Privileges
3 - blah blah...
So if you had the privilege of 2, you had everything below, and if you had 3 you had everything under that. Simple...
But I didn't want that, I needed to make a method where I can select privileges for users without them having others.
I didn't want to create more fields, so I created one new field, and I am using binary to tell the staff member what he can do.
1101
^
The first digit is poll
second is posting
third is blah blah
fourth is meh...
And all I do is Select the field, and just find out if the digit number this script requires is 1 or 0 (true or flase).
blnVariable = Mid(oRS("UserPrivileges"),2,1)
Do you think this is a fast and easy method, or should I just make many different true or false fields in my database?
I was first thinking of just a simple field beside their account name in the database that gave them a rank.
Example:
0 - No Privileges
1 - Poll Privileges
2 - Posting Privileges
3 - blah blah...
So if you had the privilege of 2, you had everything below, and if you had 3 you had everything under that. Simple...
But I didn't want that, I needed to make a method where I can select privileges for users without them having others.
I didn't want to create more fields, so I created one new field, and I am using binary to tell the staff member what he can do.
1101
^
The first digit is poll
second is posting
third is blah blah
fourth is meh...
And all I do is Select the field, and just find out if the digit number this script requires is 1 or 0 (true or flase).
blnVariable = Mid(oRS("UserPrivileges"),2,1)
Do you think this is a fast and easy method, or should I just make many different true or false fields in my database?