public function beforeFilter() { // Check If Error Page if ($this->name == 'CakeError') { return; } if ($this->CaseRecordSystem->userLogged()) { $acl = new AccessControl(); if (!$acl->hasAccess($this->CaseRecordSystem->getLoggedUser(), "controller_" . $this->params->controller, $this->params->action)) { throw new UnauthorizedException('Bu işlem için yetkiniz yok'); } } }