cakephp-3-acl-example
cakephp-3-acl-example copied to clipboard
AclNode::node() - Couldn't find Aros node identified by
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
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 solution worked for me thanks bro :+1: