예제 #1
0
 /**
  * @param Aop\JoinPoint\BeforeMethod $before
  * @throws \Nette\Security\AuthenticationException
  *
  * @Aop\Before("methodAnnotatedWith(Secure\Delete)")
  */
 public function secureDelete(Aop\JoinPoint\BeforeMethod $before)
 {
     $delete = $this->reader->getMethodAnnotation($before->getTargetReflection(), 'Secure\\Delete');
     if (!$this->authorizator->isAtLeastInRole($delete->allow, $this->user)) {
         $this->throwExcetion($before, $delete->allow);
     }
 }