English 中文(简体)
CakePhhp ACL 检查在应用程序中失败, 但不是在蛋糕控制台中失败
原标题:CakePhp ACL check fails in app but not in the cake console
  • 时间:2012-05-24 14:38:48
  •  标签:
  • cakephp
  • acl

我正在建造一个需要使用ACL的应用程序。 我试图在我的一个控制器操作中检查权限。 这是我的蛋糕控制器代码, 有效 :

./cake acl check Group.83 controllers all
Group.83 is allowed.

然而,在我的控制器里,当我使用这个代码的时候, 它应该会回到真实的:

checkPerm = $this- & gt;Acl-gt; check( 第83组, 控制器, 全部) ;

我知道这个错误:

Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in permissions check.  Node references:
Aro: Group.83
Aco: controllers [CORE/cake/libs/controller/components/acl.php, line 273]

我知道,我的ACL设置是正确的, 否则蛋糕控制台的命令会失败。 我认为它在我的控制器中有些东西, 但我不确定是什么导致了这个错误。 有什么想法吗?

最佳回答

外壳使用圆点语法是因为一个阵列或前斜线不起作用。 外壳会提取, 使其可以通过使用阵列语法的组件读取。 将您的检查修改为 :

$checkPerm = $this->Acl->check(array(
   model  =>  Group ,
   foreign_key  => 83
),  controllers ,  all );

这应该能解决它!

问题回答

暂无回答




相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签