Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/src/Entity/DownloadJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
processor: DownloadJobQueuedProcessor::class
),
new Get(
security: "object.owner == user"
),
new GetCollection(
order: ['createdAt' => 'DESC'],
Expand Down
8 changes: 7 additions & 1 deletion api/src/Entity/DownloadJobEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions api/src/Entity/DownloadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading