php - hierarchical ACl with inheritance and override -


I am providing a scenario below where I find it difficult to find out how to prepare DB structure for management May be. Any guidance and solutions will be useful

We have domains in the top level, many groups can be created under each domain, so more than one user can belong to each group of domains. Are there. We have modules (e.g., frequently asked questions, products, etc.) and actions (add, edit, delete, view etc.). There are several actions in each module (such as Add_FAQ, Edit_FAQ, etc.).

Case 1

We need to manage the permissions for these modules operations, users, domains, and permissions can be allowed on the users. If a domain is allowed to do something, then all groups and users are automatically allowed under it. Permissions can be overridden in contrast to what a group or user is given to his parents. For example, a domain X has 2 groups (grp1, grp2) and in each group the user has 2 user users 1_grp1, user2_grp1, user1_grp2, user2_grp2. Now X is allowed to remove FAQ, which means that all groups and users also allow. Now GRP1 has been denied the cancellation of the FAQ and the user2_greep2 has been refused to remove the frequently asked questions. In the end, only user1_grp2 is left to remove the frequently asked question. If no permission is given at the lower level, the permission of the guardian will be considered.

Case 2

Just like permissions, where we only need permission or reject, there is a need to manage settings & amp; For domains such as value, set to display 20 records at a time, but the value 20 can be overridden to 50 or 50 by a group or user. This means that users and groups will see 50 records at a time, while the rest will have 20 records within that domain.

Can someone suggest how to manage it with the database thanks in advance

< p> I suggest you look at ACL-magic You can create models for your use by creating groups (roles), hierarchy of resources and appropriate "concerns". The "Persistence" side can be easily applied with any database.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -