From 2e12af3c2f81f50d0b8f02f38e1ea7a955561f17 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Thu, 13 Jun 2024 15:31:30 +0200 Subject: [PATCH] refs #450. Updated security User endpoint --- config/api_platform/User.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/api_platform/User.yaml b/config/api_platform/User.yaml index 6d39866..5e005fb 100644 --- a/config/api_platform/User.yaml +++ b/config/api_platform/User.yaml @@ -1,6 +1,5 @@ resources: App\Entity\User: - security: 'is_granted("ROLE_SUPER_ADMIN")' input: App\Dto\Input\UserInput output: App\Dto\Output\UserOutput processor: App\State\Processor\UserProcessor @@ -10,6 +9,7 @@ resources: groups: ['user:write'] operations: ApiPlatform\Metadata\GetCollection: + security: 'is_granted("ROLE_SUPER_ADMIN")' provider: App\State\Provider\UserProvider filters: - 'api_platform.filter.user.order' @@ -22,9 +22,11 @@ resources: ApiPlatform\Metadata\Patch: provider: App\State\Provider\UserProvider ApiPlatform\Metadata\Post: + security: 'is_granted("ROLE_SUPER_ADMIN")' validationContext: groups: [ 'default', 'user:post' ] - ApiPlatform\Metadata\Delete: ~ + ApiPlatform\Metadata\Delete: + security: 'is_granted("ROLE_SUPER_ADMIN")' reset_password: provider: App\State\Provider\UserProvider class: ApiPlatform\Metadata\Put