src/Lib/AuthActionsTrait.php
public function initAuthActions() {
		EventManager::instance()->attach(function (\Cake\Event\Event $event) {
			// Make the AuthComponent, AuthActions and UserRights available to the view.
			// FIXME - find a clean way to do this
			if (!$event->subject() instanceof \Cake\Controller\ErrorController) {
				$viewAuthActions = [
					'AuthActions' => $event->subject()->getAuthActions(),
					'UserRights' => $event->subject()->getUserRights()
				];
				$event->subject()->set('viewAuthActions', $viewAuthActions);
			}
		}, 'Controller.beforeRender');

		if ($this->getAuthActions()->isPublicAction($this->request->params['plugin'], $this->request->params['controller'], $this->request->params['action'])) {
			$this->Auth->allow();
		}
	}
public function initAuthActions() {
		EventManager::instance()->attach(function (\Cake\Event\Event $event) {
			// Make the AuthComponent, AuthActions and UserRights available to the view.
			// FIXME - find a clean way to do this
			if (!$event->subject() instanceof \Cake\Controller\ErrorController) {
				$viewAuthActions = [
					'AuthActions' => $event->subject()->getAuthActions(),
					'UserRights' => $event->subject()->getUserRights()
				];
				$event->subject()->set('viewAuthActions', $viewAuthActions);
			}
		}, 'Controller.beforeRender');

		if ($this->getAuthActions()->isPublicAction($this->request->params['plugin'], $this->request->params['controller'], $this->request->params['action'])) {
			$this->Auth->allow();
		}
	}
Initializer, must be called in beforeFilter()

@return void