access.yaml 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #resources:
  2. # App\Entity\Access\Access:
  3. # - operations:
  4. # ApiPlatform\Metadata\GetCollection: ~
  5. #
  6. # ApiPlatform\Metadata\Get:
  7. # security: '(is_granted("ROLE_USERS_VIEW") and object.getOrganization().getId() == user.getOrganization().getId()) or (object.getId() == user.getId())'
  8. #
  9. # ApiPlatform\Metadata\Put:
  10. # security: 'is_granted("ROLE_USERS") or (object.getId() == user.getId())'
  11. #
  12. # ApiPlatform\Metadata\Delete: ~
  13. #
  14. # - operations:
  15. # ApiPlatform\Metadata\GetCollection:
  16. # name: 'cget_students'
  17. # uriTemplate: '/students'
  18. # security: 'is_granted("ROLE_USERS_VIEW")'
  19. ##
  20. # - operations:
  21. # ApiPlatform\Metadata\Get:
  22. # name: 'get_access_address'
  23. # uriTemplate: '/access_addresses/{id}'
  24. # requirements:
  25. # id: '\d+'
  26. # normalization_context:
  27. # groups: [ 'access_address', 'address' ] ]
  28. # security: 'object.getOrganization().getId() == user.getOrganization().getId()'
  29. #
  30. # - paginationClientEnabled: true