security->getUser(); if (!$user instanceof User) { throw new AccessDeniedHttpException('Only regular user can see this page'); } if (!$this->security->isGranted(ChillExportVoter::COMPOSE_EXPORT)) { throw new AccessDeniedHttpException(sprintf('Require the %s role', ChillExportVoter::COMPOSE_EXPORT)); } $exports = $this->exportManager->getExportsGrouped(true); $lastExecutions = []; foreach ($this->exportManager->getExports() as $alias => $export) { $lastExecutions[$alias] = $this->exportGenerationRepository->findExportGenerationByAliasAndUser($alias, $user, 5); } return new Response( $this->twig->render('@ChillMain/Export/layout.html.twig', [ 'grouped_exports' => $exports, 'last_executions' => $lastExecutions, ]), ); } }