/**
  * Gets the resource if the current user is granted and if the resource exists.
  *
  * @param string $resourceId The resource id
  * @param string $grant      The grant, by default is view
  *
  * @throws \Symfony\Component\Security\Core\Exception\AccessDeniedException
  *
  * @return Object
  */
 protected function getResourceIfAllowed($resourceId, $grant = 'view')
 {
     $resource = $this->repository->find($resourceId, false);
     if (!$this->context->isGranted($grant, $resource)) {
         throw new AccessDeniedException();
     }
     return $resource;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 protected function getQueryBuilder()
 {
     return parent::getQueryBuilder()->addSelect(['w'])->join('s.workflow', 'w');
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 protected function getQueryBuilder()
 {
     return parent::getQueryBuilder()->addSelect(['p', 'u'])->join('par.project', 'p')->join('par.user', 'u');
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 protected function getQueryBuilder()
 {
     return parent::getQueryBuilder()->addSelect(['p'])->join('ip.project', 'p');
 }
 function let(Reader $reader, AuthorizationCheckerInterface $context, EntityRepository $repository)
 {
     $repository->getClassName()->shouldBeCalled()->willReturn(Argument::type('string'));
     $this->beConstructedWith($reader, $context, $repository);
 }
예제 #6
0
 /**
  * {@inheritdoc}
  */
 protected function getQueryBuilder()
 {
     return parent::getQueryBuilder()->addSelect(['a', 'pr', 'p', 'r', 'rep', 's', 'w', 'l'])->leftJoin('i.assignee', 'a')->leftJoin('i.priority', 'pr')->leftJoin('i.project', 'p')->leftJoin('i.resolution', 'r')->leftJoin('i.reporter', 'rep')->leftJoin('i.status', 's')->leftJoin('i.watchers', 'w')->leftJoin('i.labels', 'l');
 }
예제 #7
0
 /**
  * {@inheritdoc}
  */
 protected function getQueryBuilder()
 {
     return parent::getQueryBuilder()->addSelect(['img', 'i', 'w'])->leftJoin('p.image', 'img')->leftJoin('p.issues', 'i')->join('p.participants', 'par')->join('p.workflow', 'w');
 }