Find out if a user is logged in with acl in cakephp 4.2

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);
	}

What does “logged in with acl” mean to you? I thought that ACL was about authorization, but being logged in is about authentication, so they are two very different things.

Thank you, what I want to know is if it’s logged in with the Auth component.

Does this answer your question?

Yes thank you very much.