security->isGranted('ROLE_USER')) { throw new AccessDeniedHttpException('Only users can download an export'); } $export = $this->exportManager->getExport($exportGeneration->getExportAlias()); return new Response( $this->twig->render('@ChillMain/ExportGeneration/wait.html.twig', ['exportGeneration' => $exportGeneration, 'export' => $export]), ); } #[Route('/api/1.0/main/export-generation/{id}/object', methods: ['GET'])] public function objectStatus(ExportGeneration $exportGeneration): JsonResponse { if (!$this->security->isGranted('ROLE_USER')) { throw new AccessDeniedHttpException('Only users can download an export'); } return new JsonResponse( $this->serializer->serialize( $exportGeneration, 'json', [AbstractNormalizer::GROUPS => ['read']], ), json: true, ); } }