2012-03-25 56 views
0

我设置这在我的AppController.phpCakePHP的ACL提供了错误

$this->Auth->authorize = array(
    'Actions' => array(
     'actionPath' => 'controllers/' 
    ) 
); 

这是我的阿索表:

id parent_id model foreign_key  alias lft  rght 
25 NULL    NULL NULL controllers  1 2 

这是我的阿罗表:

id parent_id model foreign_key  alias lft  rght 
1 1   Group 1    NULL  27 30 
15 14   User 1    NULL  28 29 

这是我的Aco_Aro表格:

id aro_id aco_id _create  _read _update  _delete 
15 1  25  1    1  1   1 

,我得到这个错误:

Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references: 
Aro: Array 
(
    [User] => Array 
     (
      [id] => 1 
      [username] => Test 
      [group_id] => 1 
      [created] => 2012-03-24 22:47:33 
      [modified] => 2012-03-24 22:47:33 
     ) 

) 

Aco: controllers/Posts/index 

回答

0

用户测试所属的阿罗如发现自己的阿罗表。表Aro中的parent_id字段定义了树。

// For eg. If i have two groups Administrator, User 
Groups 
id | name 
11 | Administrator 
22 | User 

而且 用户 //我有用户表作为

id | name | group_id 
7 | KK | 11 
9 | SS | 22 

我阿罗表将

ARO 
id | parent_id | alias | foreign_key 
1 | null | adm | 11   // Group 
2 | null | usr | 22   // Group 
3 | 1  | kk | 7   // User 
4 | 2  | SS | 9   // User 

从你阿罗/ ACL设置,蛋糕的ACL组件无法找到。 如果你想让你的生活更轻松,你可以试试Acl Plugin。这确实简化了一些明显的任务。

+0

非常感谢! – user558117 2012-03-25 13:29:03