From 5b0babb9b08d260bfc0c64be37b6b43feb4ba270 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 1 Jul 2024 15:37:47 +0200 Subject: [PATCH] Implement permissions in AsyncUploadVoter.php --- .../Security/Authorization/AsyncUploadVoter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php index 1d7ad759a..d458bae08 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php @@ -36,6 +36,13 @@ final class AsyncUploadVoter extends Voter return false; } + //TODO get the StoredObject from the SignedUrl +/* match($subject->method) { + 'GET' => $this->security->isGranted('SEE', $storedObject), + 'PUT' => $this->security->isGranted('EDIT', $storedObject), + 'POST' => $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN') + };*/ + return $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN'); } }