/** * 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; }
/** * {@inheritdoc} */ protected function getQueryBuilder() { return parent::getQueryBuilder()->addSelect(['w'])->join('s.workflow', 'w'); }
/** * {@inheritdoc} */ protected function getQueryBuilder() { return parent::getQueryBuilder()->addSelect(['p', 'u'])->join('par.project', 'p')->join('par.user', 'u'); }
/** * {@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); }
/** * {@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'); }
/** * {@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'); }