2012-03-25 59 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