Accessing controller authorization through template View

the can(…) function is unknown. From the documentation I am not sure if I have to change the UserEntity.php, since I use $id = $this->request->getAttribute('identity'); instead of user_id
I added use Authorization\Identity; to the Application.php since

"If your application uses the cakephp/authentication plugin then the Authorization\Identity class will be used. This class implements the Authentication\IdentityInterface` in addition to the Authorization\IdentityInterface . "

This seems redundant though, as it states it already will be used automatically?
I followed the authorization tutorial so it is loaded in my Apllication.php and its middleware function. Although I miss the ResponseInterface $response in the public function getAuthorizationService().

So $id is the attribute identity now. What type of object is this?