access.yaml 939 B

123456789101112131415161718192021222324252627282930313233343536
  1. App\Entity\Access\Access:
  2. collectionOperations:
  3. get: ~
  4. cget_students:
  5. method: GET
  6. path: '/students'
  7. security: 'is_granted("ROLE_USERS_VIEW")'
  8. cget_admin:
  9. method: GET
  10. path: '/admin'
  11. cget_access_person_ref:
  12. method: GET
  13. path: '/access_people'
  14. normalization_context:
  15. groups: ['access_people_ref']
  16. itemOperations:
  17. get:
  18. security: '(is_granted("ROLE_USERS_VIEW") and object.getOrganization().getId() == user.getOrganization().getId()) or (object.getId() == user.getId())'
  19. get_access_address:
  20. method: GET
  21. path: '/access_addresses/{id}'
  22. requirements:
  23. id : '\d+'
  24. normalization_context:
  25. groups: ['access_address', 'address']]
  26. security: 'object.getOrganization().getId() == user.getOrganization().getId()'
  27. put:
  28. security: 'is_granted("ROLE_USERS") or (object.getId() == user.getId())'
  29. delete: ~