我正在实施一个产品库存管理网站,女巫有很多层次的权限。它有一个拥有各种权限的管理员,然后是 2、3、4 级等......将拥有更少的权限。但特定用户可以拥有特殊权限,例如创建用户或读取有关其他用户的信息。
考虑以下场景:
* admin inserted user1, user2 and user3.
* user1 inserted user4 and user5 under his supervision.
* user1 edited user4's permission so: user4 can see all user5's
activity, but user5 cannot see user4's 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.
如何使这个权限树隐含在我的数据库中?
权限树的图形方案: