mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-02-24 09:10:00 +00:00
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:
7
.changes/unreleased/Feature-20260223-151808.yaml
Normal file
7
.changes/unreleased/Feature-20260223-151808.yaml
Normal 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
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user