cakephp-3-acl-example icon indicating copy to clipboard operation
cakephp-3-acl-example copied to clipboard

AclNode::node() - Couldn't find Aros node identified by

Open anonibox1488 opened this issue 8 years ago • 2 comments

Mi problema es: AclNode::node() - Couldn't find Aros node identified by "Array ( [Aros0.model] => Users [Aros0.foreign_key] => 45 ) " en mi aplicación la tabla "users" se llama usuarios_externos, lo unico que cambio fue : public function parentNode() { if (!$this->id) { return null; } if (isset($this->group_id)) { $groupId = $this->group_id; } else { $Users = TableRegistry::get('UsuariosExternos'); $user = $Users->find('all', ['fields' => ['group_id']])->where(['id' => $this->id])->first(); $groupId = $user->group_id; } if (!$groupId) { return null; } return ['Groups' => ['id' => $groupId]]; }

Les agradezco la ayuda.. THX

anonibox1488 avatar Nov 28 '16 21:11 anonibox1488

Español de Google Translate... :)

Cuando incluye y configura el AuthComponent y el AclComponent en el AppController, agregue el nombre de su modelo:

$this->loadComponent('Auth', [
    'authorize' => [
        'Acl.Actions' => [
            'actionPath' => 'controllers/',
            'userModel' => 'UsuariosExternos',
        ]
    ],
    // ... más configuración
]);

mikeu avatar Dec 02 '16 23:12 mikeu

@mikeu solution worked for me thanks bro :+1:

hareshpatel1990 avatar Dec 09 '16 06:12 hareshpatel1990