Ver código fonte

post MR fixes

Olivier Massot 2 anos atrás
pai
commit
3b39657667
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      src/ApiResources/Cotisation/Cotisation.php

+ 3 - 1
src/ApiResources/Cotisation/Cotisation.php

@@ -16,7 +16,9 @@ use Symfony\Component\Validator\Constraints as Assert;
  * Security :
  *   * @see App\Security\Voter\CotisationVoter
  */
-#[ApiResource(operations: [])]
+#[ApiResource(operations: [
+    new Get(security: "is_granted('ROLE_COTISATION') and object.getOrganization().getId() == user.getOrganization().getId()")
+])]
 class Cotisation implements ApiResourcesInterface
 {
     #[ApiProperty(identifier: true)]