我为CakePHP应用程序设置了自定义身份验证系统。现在我们需要包含一些ACL。我按照here的说明进行操作。现在由于某种原因,我需要使用表admin_users和admin_user_roles而不是通常的组和用户。我可以登录,但ARO搜索失败。它给了我以下错误。
Warning (512): AclNode::node() - Couldn't find Aro node identified by "Array
(
[Aro0.model] => User
[Aro0.foreign_key] => 4
)
" [CORE/Cake/Model/AclNode.php, line 176]
Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:
Aro: Array
(
[User] => Array
(
[id] => 4
[admin_user_role_id] => 1
[email] => mio@kalibrr.com
[username] => mio
[created] => 2012-09-28 08:03:25
[modified] => 2012-10-01 02:09:42
)
)
Aco: controllers/Dashboard/index [CORE/Cake/Controller/Component/AclComponent.php, line 303]
似乎仍然在用户模型中寻找它。有没有办法改变它,以便在AdminUsers表中查找它?
在DB和Model字段中查找都指向AdminUser。
答案 0 :(得分:3)
解决。
添加到Appcontroller这一行
'authorize' => array(
'Actions' => array('userModel' => 'AdminUser','actionPath' => 'controllers')
此处AdminUser是我的模型的名称。