From bf56b3cc65baa0c431fe24ca2005d32e51cf9fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 23 Feb 2026 14:24:53 +0000 Subject: [PATCH] =?UTF-8?q?Resolve=20"T=C3=A9l=C3=A9chargement=20des=20doc?= =?UTF-8?q?uments=20d'un=20workflow:=20limiter=20=C3=A0=2030=20t=C3=A9l?= =?UTF-8?q?=C3=A9chargements=20plut=C3=B4t=20que=20100"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changes/unreleased/Feature-20260223-151808.yaml | 7 +++++++ .../Controller/WorkflowViewSendPublicController.php | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .changes/unreleased/Feature-20260223-151808.yaml diff --git a/.changes/unreleased/Feature-20260223-151808.yaml b/.changes/unreleased/Feature-20260223-151808.yaml new file mode 100644 index 000000000..2d134c8af --- /dev/null +++ b/.changes/unreleased/Feature-20260223-151808.yaml @@ -0,0 +1,7 @@ +kind: Feature +body: Limit the number of public download of stored object to 30 downloads +time: 2026-02-23T15:18:08.688011924+01:00 +custom: + Issue: "500" + MR: "964" + SchemaChange: No schema change diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php index 9cd4fd6f7..1a005c4c7 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php @@ -62,15 +62,15 @@ final readonly class WorkflowViewSendPublicController ); } - if (100 < $workflowSend->getViews()->count()) { - $this->chillLogger->info(self::LOG_PREFIX.'100 view reached, not allowed to see it again'); - throw new AccessDeniedHttpException('100 views reached, not allowed to see it again'); + if (30 < $workflowSend->getViews()->count()) { + $this->chillLogger->info(self::LOG_PREFIX.'30 view reached, not allowed to see it again'); + throw new AccessDeniedHttpException('30 views reached, not allowed to see it again'); } try { $metadata = new EntityWorkflowViewMetadataDTO( $workflowSend->getViews()->count(), - 100 - $workflowSend->getViews()->count(), + 30 - $workflowSend->getViews()->count(), ); $response = new Response( $this->entityWorkflowManager->renderPublicView($workflowSend, $metadata),