diff --git a/config/api_platform/Client.yaml b/config/api_platform/Client.yaml index f3cfc0d..35e9698 100644 --- a/config/api_platform/Client.yaml +++ b/config/api_platform/Client.yaml @@ -25,7 +25,7 @@ resources: validationContext: groups: [ 'client:patch' ] ApiPlatform\Metadata\Post: - security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN")' + security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_OPERATOR")' ApiPlatform\Metadata\Delete: ~ delete_multiple_clients: diff --git a/config/api_platform/OrganizationalUnit.yaml b/config/api_platform/OrganizationalUnit.yaml index 17e304b..f5668c1 100644 --- a/config/api_platform/OrganizationalUnit.yaml +++ b/config/api_platform/OrganizationalUnit.yaml @@ -27,7 +27,7 @@ resources: validationContext: groups: ['organizational-unit:patch' ] ApiPlatform\Metadata\Post: - security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN")' + security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_OPERATOR")' ApiPlatform\Metadata\Delete: security: 'is_granted("ROLE_SUPER_ADMIN") or (is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN") and object.getCreatedBy() == user.getUserIdentifier())' securityMessage: 'You can only delete organizational units you created.' diff --git a/config/packages/security.yaml b/config/packages/security.yaml index c0f8945..e3b317a 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -39,9 +39,9 @@ security: - { path: ^/validate, roles: PUBLIC_ACCESS } - { path: ^/menu-browser, roles: PUBLIC_ACCESS } - { path: ^/menu/, roles: PUBLIC_ACCESS } - # Creación de clientes y OUs: solo super-admin y ou-admin - - { path: ^/clients$, methods: [POST], roles: [ROLE_SUPER_ADMIN, ROLE_ORGANIZATIONAL_UNIT_ADMIN] } - - { path: ^/organizational-units$, methods: [POST], roles: [ROLE_SUPER_ADMIN, ROLE_ORGANIZATIONAL_UNIT_ADMIN] } + # Creación de clientes y OUs: super-admin, ou-admin y ou-operator + - { path: ^/clients$, methods: [POST], roles: [ROLE_SUPER_ADMIN, ROLE_ORGANIZATIONAL_UNIT_ADMIN, ROLE_ORGANIZATIONAL_UNIT_OPERATOR] } + - { path: ^/organizational-units$, methods: [POST], roles: [ROLE_SUPER_ADMIN, ROLE_ORGANIZATIONAL_UNIT_ADMIN, ROLE_ORGANIZATIONAL_UNIT_OPERATOR] } # ogLive puede consultar clientes por IP con su API key - { path: ^/clients, methods: [GET], roles: [ROLE_OGCLIENT_API, ROLE_USER] } - { path: ^/, roles: ROLE_USER }