diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php index 25981db1e..708df0467 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php @@ -34,16 +34,16 @@ final class AsyncUploadVoter extends Voter protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { /** @var SignedUrl $subject */ - if (!in_array($subject->method, ['POST', 'GET', 'HEAD'], true)) { + if (!in_array($subject->method, ['POST', 'GET', 'HEAD', 'PUT'], true)) { return false; } $storedObject = $this->storedObjectRepository->findOneBy(['filename' => $subject->object_name]); return match ($subject->method) { - 'GET' => $this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject), + 'GET', 'HEAD' => $this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject), 'PUT' => $this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObject), - 'POST', 'HEAD' => $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN') + 'POST' => $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN') }; } }