diff --git a/src/DataPersister/ProxyDataPersister.php b/src/DataPersister/ProxyDataPersister.php index 07bcfdf5523541f512a3975b8f710ca09c006eb0..d6dc5c36b2e06041f245af24b8ae6408f49a32f9 100644 --- a/src/DataPersister/ProxyDataPersister.php +++ b/src/DataPersister/ProxyDataPersister.php @@ -33,6 +33,7 @@ class ProxyDataPersister extends AbstractController implements ContextAwareDataP public function persist($data, array $context = []): ProxyData { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); + $this->denyAccessUnlessGranted('ROLE_SCOPE_API-PROXY'); if (Tools::isNullOrEmpty($data->getNamespace())) { throw new BadRequestException('parameter namespace must not be null nor empty'); @@ -55,5 +56,6 @@ class ProxyDataPersister extends AbstractController implements ContextAwareDataP public function remove($data, array $context = []): void { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); + $this->denyAccessUnlessGranted('ROLE_SCOPE_API-PROXY'); } } diff --git a/src/DataProvider/ProxyDataCollectionDataProvider.php b/src/DataProvider/ProxyDataCollectionDataProvider.php index 4321d8a9fbf2d9ee0acbe264f2258e2446fcac5d..06d89d7035b9b287128959667e2e3c5fe718fc8e 100644 --- a/src/DataProvider/ProxyDataCollectionDataProvider.php +++ b/src/DataProvider/ProxyDataCollectionDataProvider.php @@ -19,6 +19,7 @@ final class ProxyDataCollectionDataProvider extends AbstractController implement public function getCollection(string $resourceClass, string $operationName = null, array $context = []): iterable { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); + $this->denyAccessUnlessGranted('ROLE_SCOPE_API-PROXY'); return []; } diff --git a/src/DataProvider/ProxyDataItemDataProvider.php b/src/DataProvider/ProxyDataItemDataProvider.php index eaf1ecd8efc3d156423d4acead610924009d4346..3b48cd2f522ce2689dcb5b188ff4453c59c35bb8 100644 --- a/src/DataProvider/ProxyDataItemDataProvider.php +++ b/src/DataProvider/ProxyDataItemDataProvider.php @@ -19,6 +19,7 @@ final class ProxyDataItemDataProvider extends AbstractController implements Item public function getItem(string $resourceClass, $id, string $operationName = null, array $context = []): ?ProxyData { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); + $this->denyAccessUnlessGranted('ROLE_SCOPE_API-PROXY'); return null; } diff --git a/src/Entity/ProxyData.php b/src/Entity/ProxyData.php index a73602ad482fd4f629baf27e51814d85056099ec..55277ac6ee06150141113b0034aae8300214ef32 100644 --- a/src/Entity/ProxyData.php +++ b/src/Entity/ProxyData.php @@ -12,7 +12,6 @@ use Symfony\Component\Serializer\Annotation\Groups; * @ApiResource( * collectionOperations={ * "post" = { - * "security" = "is_granted('IS_AUTHENTICATED_FULLY')", * "path" = "/proxy/proxydata", * "openapi_context" = { * "tags" = {"Proxy"}, @@ -26,7 +25,6 @@ use Symfony\Component\Serializer\Annotation\Groups; * } * }, * "get" = { - * "security" = "is_granted('IS_AUTHENTICATED_FULLY')", * "path" = "/proxy/proxydata", * "openapi_context" = { * "tags" = {"Proxy"},