What is the method to find out that a user is logged in with acl? I now that with authentication is getResult, I want the equivalent in acl. I found out that the method $user = $this->Auth->identify(); sets the variable with the array of the user logged in, but it doesn’t make it available for templates with $this->set(‘user’, $user);
How can I do to set the variable for templates.
This is the code for beforeFilter method in AppController:
public function beforeFilter(EventInterface $event)
{
parent::beforeFilter($event);
$user = $this->Auth->identify();
$this->set('user', $user);
}