fix(ogcore): restringir creacion de OUs y clientes a ou-admin y superior

El POST de OrganizationalUnit y Client queda restringido a
ROLE_SUPER_ADMIN o ROLE_ORGANIZATIONAL_UNIT_ADMIN. Los operadores
(ROLE_ORGANIZATIONAL_UNIT_OPERATOR) ya no pueden crear aulas ni
clientes via API.
pull/123/head
Nicolas Arenas 2026-05-27 12:03:43 +02:00
parent 6d35163b3f
commit b1903ea321
2 changed files with 4 additions and 2 deletions

View File

@ -24,7 +24,8 @@ resources:
provider: App\State\Provider\ClientProvider
validationContext:
groups: [ 'client:patch' ]
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN")'
ApiPlatform\Metadata\Delete: ~
delete_multiple_clients:

View File

@ -26,7 +26,8 @@ resources:
provider: App\State\Provider\OrganizationalUnitProvider
validationContext:
groups: ['organizational-unit:patch' ]
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN")'
ApiPlatform\Metadata\Delete: ~
change_parent:
class: ApiPlatform\Metadata\Post