Merge branch '500-limit-public-download' into 'master'

Resolve "Téléchargement des documents d'un workflow: limiter à 30 téléchargements plutôt que 100"

Closes #500

See merge request Chill-Projet/chill-bundles!964
This commit is contained in:
2026-02-23 14:24:53 +00:00
2 changed files with 11 additions and 4 deletions

View File

@@ -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

View File

@@ -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),