无法使 CakePHP Cookbook 简单 ACL 示例正常工作
我在 ACL 与 CakePHP 一起使用时遇到问题。我一直在使用 CakePHP Cookbook 2.0 示例 简单的 Acl 控制的应用程序,并且已经执行了两次这些步骤,但两次都遇到了相同的问题。
一切似乎都设置正确。
- 我能够创建我的组和用户。
- aros 表似乎具有与网络示例中显示的相同的行。
- acos 和 aros_acos 表似乎填充了与文章类似的值。
- 当我访问设置为受保护的页面时,我会看到登录页面。
但是,当我使用我创建的帐户登录时,我看到以下错误:
Warning (512): DbAcl::check() -
Failed ARO/ACO node lookup in permissions check. Node references:
Aro: Array
(
[User] => Array
(
[id] => 1
[username] => dc
[email] => [email protected]
[group_id] => 1
[created] => 2011-10-27 14:58:59
[modified] => 2011-10-27 14:58:59
)
)
Aco: /Posts/add [CORE/Cake/Controller/Component/AclComponent.php, line 303]
该帐户被设置为管理员,并且管理员组已被授予对所有内容的访问权限......所以如果它有效,我应该不会有问题。 ..但似乎有一个较低级别的问题阻碍了我。如果有帮助的话,我也可以发布我的数据库表,但我想我应该从这里开始。感谢您提供的任何见解。
I'm having problems getting ACL working with CakePHP. I've been working with the CakePHP Cookbook 2.0 example Simple Acl controlled Application, and have gone through the steps twice, but I've run into the same problem both times.
Everything appears to be setup correctly.
- I'm able to create my groups, and users.
- The aros table appears to have the same rows shown in the example on the web.
- The acos and aros_acos tables appear to get populated with values that resemble the article.
- And when I visit a page that's setup to be protected, I'm presented with the login page.
But when I login using the account I created, I see the following error:
Warning (512): DbAcl::check() -
Failed ARO/ACO node lookup in permissions check. Node references:
Aro: Array
(
[User] => Array
(
[id] => 1
[username] => dc
[email] => [email protected]
[group_id] => 1
[created] => 2011-10-27 14:58:59
[modified] => 2011-10-27 14:58:59
)
)
Aco: /Posts/add [CORE/Cake/Controller/Component/AclComponent.php, line 303]
That account is setup as an administrator, and the administrator group has been granted access to everything ... so if it works, I shouldn't have a problem ... but it seems like there's a lower-level problem that's getting in my way. I can post my DB tables as well if that'd be helpful, but figured I'd start here. Thanks for any insight you can provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更新了文档以解决此问题。如果您将其添加到 AppController 的 beforeFilter 方法中,则可以解决该问题。
The documentation was updated to address this issue. If you add this in the beforeFilter method in AppController it resolves the problem.
在 beforeFilter() 中添加
$this->Auth->allow('initDB');
Add
$this->Auth->allow('initDB');
in beforeFilter()