User Web Based Permissions

wxdqz

New Member
I want to discuss the best way to give certain users certain types of permissions for editing web content and web accounts with PHP and MySQL.
Here is the situation:
I have administrators that I would like to store in a table. Of these administators, some will have the ablitiy to edit one type of page content(stored in MySQL tables), others will have the ability to edit other pages (stored in MySQL tables)and some will have the ability to edit the administators and to give them permission to edit page content (administrators also stored in a table)
Here are the possiblities I would like to discuss:
Situation One.............
-An "Admin" table that stores user names
[admin_id(unique)][user_name][password]

-A "content type table" with the type of content pages that is referenced through a content table to determine the type of content
[content_type_id(unique)][content_type_name]

-A permissions table that contains references to the admin and to the content type that they can edit, create or delete(which could be also controled through permission)
[admin_id(indexed but not unique)][content_type_id]

This would match up the permissions a user has by admin_id and content_type_id

Situation two............
-An "Admin" table that stores user names and a permissions field that contains an array of letters that represent a type of content
or editing right.
ex. if the letter "A" represented administration of administrators then an array of A, R, S would indicate the the user had rights to edit the administrators information and rights to two other types of editing.
[admin_id(unique)][user_name][password][permissions(array of letters)]

-a "Permissions" table containing a letter that references a type of permission
[permission_id][letter(this is the letter to be placed into the array in the admin table)][name(name of permission)]

******************
I personally think that the first situation is less hairy and that in the long run may be more manageable but I may be wrong.

Please reply as much as possible. I would love to get different views and also different possiblities.
 
Back
Top