无法获取CakePHP Cookbook简单ACL示例工作

编程入门 行业动态 更新时间:2024-10-09 20:24:51
本文介绍了无法获取CakePHP Cookbook简单ACL示例工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法使用CakePHP处理ACL。我一直在使用CakePHP Cookbook 2.0示例简单的Acl控制应用程序,并已经执行了两次步骤,但我遇到了同样的问题两次。

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.

一切似乎设置正确。

  • 我的群组和使用者。
  • aros 表格似乎与网络上的示例中显示的行相同。
  • acos aros_acos 表格似乎会填充类似文章的值。
  • 当我访问的网页
  • 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] => myemail@somedomain [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.

推荐答案

文档已更新,以解决此问题。如果你在AppController的beforeFilter方法中添加它,它会解决这个问题。

The documentation was updated to address this issue. If you add this in the beforeFilter method in AppController it resolves the problem.

$this->Auth->authorize = array( AuthComponent::ALL => array('actionPath' => 'controllers'), 'Actions', );

更多推荐

无法获取CakePHP Cookbook简单ACL示例工作

本文发布于:2023-11-28 10:54:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642109.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:示例   简单   工作   CakePHP   Cookbook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!