tags:

views:

27

answers:

2

I have plugin

  plugin: tree 
  -----controller: tree
  -------------action : admin_index

DB Table aros_acos has updated _CRUD 1 1 1 1 for this aco. I code $this->Acl->check(array('model'=>'User','foreign_key'=>2),'Tree/Tree/admin_index');

error:

DbAcl::check() - Failed ARO/ACO node lookup in permissions check.  Node references:
Aro: Array
(
    [model] => User
    [foreign_key] => 2
)

Aco: Tree/Tree/admin_index [CORE\cake\libs\controller\components\acl.php, line 273]

All other action is permission valid but action of plugins, I cant find reason . Anyone help me.

A: 

I don't understand why you have Tree as a plugin - it's a core behaviour.

Please post the appropriate rows from the aros_acos table.

The array you pass into Acl->check doesn't look right to me. I pass in the output of $this->Auth->user() which looks like:

Array
(
    [User] => Array
        (
            [id] => 12
            [username] => somebody
            [group_id] => 1
        )
)

Have a look at Mark Story's tutorial - it really is excellent: http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1

Leo
He uses the correct syntax - http://book.cakephp.org/view/1249/Checking-Permissions-The-ACL-Component
bancer
A: 
  1. There was a change in Cakephp 1.3. Only the index route is supported for the controller that is named the same as plugin. So, you will need to handle that first if you use 1.3 version.

  2. Check the ARO and ACO tree in the console: cake acl view aco, cake acl view aro. Try to check the permissions from console cake acl check YOURARO YOURACO all

bancer