/**
* @return bool
* @throws \ManaPHP\Security\CsrfToken\Exception
* @throws \ManaPHP\Http\Request\Exception
* @throws \ManaPHP\Security\Crypt\Exception
*/
public function _eventHandlerBeforeExecuteRoute()
{
$ignoreMethods = ['GET', 'HEAD', 'OPTIONS'];
if (isset($this->csrfToken) && !in_array($this->request->getMethod(), $ignoreMethods, true)) {
$this->csrfToken->verify();
}
$r = $this->_moduleObject->authorize($this->dispatcher->getControllerName(), $this->dispatcher->getActionName());
if ($r === false || is_object($r)) {
return false;
} else {
return true;
}
}