From 4913418ddd565f1a394cdb89b70aea856f1ae79e Mon Sep 17 00:00:00 2001 From: PBX_g33k Date: Sat, 22 Aug 2026 22:01:32 +0200 Subject: [PATCH 1/2] FIX: Download job endpoints --- api/src/Entity/DownloadJob.php | 1 - api/src/Entity/DownloadJobEvent.php | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/src/Entity/DownloadJob.php b/api/src/Entity/DownloadJob.php index 1883a7a..8a12057 100644 --- a/api/src/Entity/DownloadJob.php +++ b/api/src/Entity/DownloadJob.php @@ -38,7 +38,6 @@ processor: DownloadJobQueuedProcessor::class ), new Get( - security: "object.owner == user" ), new GetCollection( order: ['createdAt' => 'DESC'], diff --git a/api/src/Entity/DownloadJobEvent.php b/api/src/Entity/DownloadJobEvent.php index e27e1b0..ffc626a 100644 --- a/api/src/Entity/DownloadJobEvent.php +++ b/api/src/Entity/DownloadJobEvent.php @@ -10,6 +10,7 @@ use App\Interface\OwnerFilterableInterface; use App\Repository\DownloadJobEventRepository; use Doctrine\ORM\Mapping as ORM; +use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Gedmo\Timestampable\Traits\TimestampableEntity; @@ -175,7 +176,12 @@ public static function getOwnerQueryBuilder(QueryBuilder $queryBuilder, string $ { $rootAlias = $queryBuilder->getRootAliases()[0]; return $queryBuilder - ->andWhere('download_job.owner = :owner') + ->innerJoin( + sprintf('%s.downloadJob', $rootAlias), + 'dj', + Join::INNER_JOIN + ) + ->andWhere('dj.owner = :owner') ->setParameter('owner', $ownerIdentifier); } } From e1a161d3662c8c4b81d9354ca28e6176a1eecd21 Mon Sep 17 00:00:00 2001 From: PBX_g33k Date: Sat, 22 Aug 2026 22:14:39 +0200 Subject: [PATCH 2/2] FIX: downloaded files --- api/src/Entity/DownloadedFile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Entity/DownloadedFile.php b/api/src/Entity/DownloadedFile.php index 343ee07..6fd86bc 100644 --- a/api/src/Entity/DownloadedFile.php +++ b/api/src/Entity/DownloadedFile.php @@ -13,12 +13,12 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\QueryBuilder; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; #[ApiResource( uriTemplate: '/download_jobs/{downloadJobUuid}/files.{_format}', operations: [new GetCollection( - normalizationContext: ['groups' => ['downloadedFile:read']] +// normalizationContext: ['groups' => ['downloadedFile:read']] )], uriVariables: [ 'downloadJobUuid' => new Link(