views:

186

answers:

1

Implement multi-level hierarchies so that super user have also all rights that sub user have means super user can also manage sub-users jobs.

How design the database for this.

+3  A: 

I think what you might be looking for is a ACL libary.

ACL stands for Access Control List. it uses 2 "sub models" called ARO and ACO.

Aro's are what is "requesting the data" - e.g. the user/group (and can be structured as a tree using nested sets, or a simple recursive tree [parent_id]).

Aco's are what is being requested - a certain model, a page, a function - what ever.

then you combine the two (aco and aro) to create the ACL - basicly saying "this user/group can/can't use this model/page"

According to your tags i see you're looking for a PHP/MySQL solution - so phpGACL might be very helpful to you: http://phpgacl.sourceforge.net/

Its a complete "framework" for managing ACL's which you can easily combine into your application (how ever its structured).

Hope that helped you out a bit - or atleast pointed you in the right direction.

Ken
Nice answer, and nice of you to take the time to attack a question that appears to have confused many. My only problem with phpGACL is that it was last update over 3 years ago, know any alternatives or PHP5 equivalents?
Wally Lawless
Thank you, i guess this is what stack overflow is all about.well googling "phpGACL php5" raise this topic which might push you in the right direction:http://codingforums.com/showthread.php?t=152966(the first post)
Ken