Olivier Massot 2 rokov pred
rodič
commit
3b39657667

+ 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)]