User rights tree: how to get there?

I am implementing a product inventory management site, because it has many permission levels. He has an administrator who has all kinds of permissions, and then level 2, 3, 4, etc., which will have fewer permissions. But specific users may have special permissions, for example, to create users or read information about other users.

Consider the following scenario:

 * admin inserted user1, user2 and user3.
 * user1 inserted user4 and user5 under his supervision.
 * user1 edited user4 permission so: user4 can see all user5's
   activity, but user5 cannot see user4 activity.
 * user5 inserted user6 and user7 and can see all their activity, but
   user4 cant!
 * user2 is in the same "level" and user1 and user3, but he cant see
   their sublevels activity.

How can I use this permission tree in my database?

Graphic tree of permissions:

enter image description here

+3
source share
1 answer

{id, username, password,..., owner}, - , .

ACL {userid, updatepriviledgeid, deleteuserid, updateuserid, viewid,..., wholetree,...} ( ) , , updatepriviledgeid , . wholetreeupdtae , ,

+1

All Articles