Cakephp 2.0.4 ACL错误

时间:2012-02-21 22:29:22

标签: php cakephp acl

我在ACL中遇到错误。

Warning (512): AclNode::node() - Couldn't find Aro node identified by "Array
(
    [Aro0.model] => Group
    [Aro0.foreign_key] => 1
)
" [CORE/Cake/Model/AclNode.php, line 179]
Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in permissions check.  Node references:
Aro: Array
(
    [User] => Array
        (
            [id] => 9
            [username] => hybmg57
            [created] => 2012-02-08 22:20:23
            [welcome] => 
            [group_id] => 1
            [options] => a:8:{i:0;s:8:"locality";i:1;s:8:"postcode";i:2;s:13:"dwelling_type";i:3;s:13:"typical_value";i:4;s:3:"dsr";i:5;s:11:"dsr_summary";i:6;s:5:"yield";i:7;s:2:"sr";}
        )

)

Aco: controllers/Users/my_favourite_suburbs [CORE/Cake/Controller/Component/AclComponent.php, line 303]

有什么我可以改变来使这个工作?我在Cake的网站上跟随了Cookbook的例子。

2 个答案:

答案 0 :(得分:0)

由于ACL中缺少权限而导致此错误。确保您已将Group 1的权限分配给controllers - > Users - > my_favourite_suburbs。查看acosarosacos_aros表格。

请注意,acosaros表格是树木,lftrght的值必须正确设置。

答案 1 :(得分:0)

我也遇到了同样的错误。但是当我添加

App::uses('AclComponent', 'Controller/Component');
在用户模型中

,现在它正在工作。