How does php perform permission management? How does php design permission allocation after login? for example, six people have different system permissions. how can I design a database, how can I determine different permissions after logging on to the system?
Reply to discussion (solution)
Http://bbs.csdn.net/topics/390610933
The table relationship is clear, and you need to complete the function on your own.
The table relationship is clear, and you need to complete the function on your own.
Alas, I can't understand it. I 've always been using a stupid method ~~
It doesn't need to be so complicated. it's just a combined game.
$ D = array ('browsed ', 'new', 'modify', 'delete'); $ u = array (,); foreach ($ u as $ k) {echo "\ n $ k"; foreach ($ d as $ p => $ v) echo $ p = ($ p & $ k )? $ V :'';}0 browsing
1. browse New
2. browse and modify
3. browse new, modify, and delete
You need to determine the use of RBAC1, RBAC2, RBAC3 as needed, but the principles are similar.
The method I often use is
Administrator 1:
{
[Permission type 1] => [read, write, repair, delete],
[Permission type 2] => [read],
...
}
Check (permission type, permission)
This should be designed based on your needs. If your permission division is simple, such as adding, deleting, modifying, and querying permissions for data objects, you can directly refer to the linux directory access permission code design without setting the "role" prototype. If it is more complex, you can refer to the design on the second floor. I think the design on the second floor is suitable for complicated permission management.
You can refer to the RBAC management of ThinkPHP to set up three tables, one user table, one permission table, and one role table. when the three tables are associated, the RBAC permission management is constructed, with this idea, we can build a very good permission management platform.