瀏覽代碼

post MR fixes

Olivier Massot 2 年之前
父節點
當前提交
3b39657667
共有 1 個文件被更改,包括 3 次插入1 次删除
  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)]