Пример #1
0
 /**
  * @param $element
  *
  * @throws Application\ForbiddenRequestException
  */
 public function checkRequirements($element)
 {
     parent::checkRequirements($element);
     if (!$this->requirementsChecker->isAllowed($element)) {
         throw new Application\ForbiddenRequestException();
     }
 }
Пример #2
0
 /**
  * @param $element
  * @throws Application\ForbiddenRequestException
  */
 public function checkRequirements($element)
 {
     $redirectUrl = $this->permission->getRedirectUrl();
     try {
         parent::checkRequirements($element);
         if (!$this->requirementsChecker->isAllowed($element)) {
             throw new Application\ForbiddenRequestException();
         }
     } catch (Application\ForbiddenRequestException $e) {
         if ($redirectUrl) {
             $this->getPresenter()->redirect($redirectUrl, array('backlink' => $this->storeRequest()));
         } else {
             throw $e;
         }
     }
 }