Ejemplo n.º 1
0
 /**
  * @param JobInterface $job
  */
 protected function isGrantedJobAccess(JobInterface $job)
 {
     if (!$job instanceof UserAwareInterface) {
         throw new AccessDeniedHttpException();
     }
     $jobUser = $job->getUser();
     $currentUser = $this->tokenStorage->getToken()->getUser();
     if (!$jobUser instanceof EquatableInterface) {
         throw new AccessDeniedHttpException();
     }
     if (!$jobUser->isEqualTo($currentUser)) {
         throw new AccessDeniedHttpException();
     }
 }