- cd进入app目录,php c:/wamp/www/acl/cake/console/cake.php schema create DbAcl, 会自动创建三张表,acos,aros,aros_acos
- user,group与acl关联
- 建立3个group,administrator,managers,users,3个user, admin1,manager1,user1,同时aros表会被更新
- +----+-----------+-------+-------------+-------+------+------+
| id | parent_id | model | foreign_key | alias | lft | rght |
+----+-----------+-------+-------------+-------+------+------+
| 1 | NULL | Group | 1 | NULL | 1 | 4 |
| 2 | NULL | Group | 2 | NULL | 5 | 8 |
| 3 | NULL | Group | 3 | NULL | 9 | 12 |
| 4 | 1 | User | 1 | NULL | 2 | 3 |
| 5 | 2 | User | 2 | NULL | 6 | 7 |
| 6 | 3 | User | 3 | NULL | 10 | 11 |
+----+-----------+-------+-------------+-------+------+------+ - http://localhost/groups/build_acl, This will build your ACO table
- http://localhost/users/initDB,建立关联,如果只想建立基于group的权限,在user model中加入 ,This method will tell ACL to skip checking
User
Aro's and to check onlyGroup
Aro's. 如果也要给User权限,bindNode方法要去掉,并添加关联 - 如果老是出现Warning: Cannot modify header information - headers already sent by ,修改php.ini, output_buffering=on, restart apache
cakephp acl
最新推荐文章于 2021-03-17 13:44:59 发布