Body: <p>We are using the <code>hook_civicrm_selectWhereClause</code> hook to apply ACLs (Access Control Lists) for the Eck_Collection_Camp entity. However, the current implementation only works for one subtype for particular custom group, and we are unable to differentiate other subtypes of same entity within the same hook. This limitation arises because we do not receive any unique identifier in the parameters to differentiate between subtypes.</p>
  <p>Current Implementation:
  In the existing code, we apply ACL checks for the Eck_Collection_Camp entity as follows:</p>
  <pre><code>public static function aclCollectionCamp(string $entity, array &amp;$clauses, int $userId, array $conditions) {
      if ($entity !== 'Eck_Collection_Camp') {
          return FALSE;
      }
  ......
  ....
  
  }
  </code></pre>
  <p>This works fine for one entity subtype (Eck_Collection_Camp), but does not account for other subtypes.</p>
  <p>Does someone knows how we can fis this issue?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-04T15:45:32.960Z
Comments.Text: I think you are using the entity construction kit to create your entity, based on the name, but you haven't said anything else about it (e.g. you don't mention what type it's a collection camp of?). This question is kind of impossible to answer, a bit too much in the weeds ...
Comments.UserDisplayName: Alan Dixon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-07T15:31:29.073Z
Comments.Text: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comments.UserDisplayName: Community
Tags: <webform-civicrm><civicrm-entity><formbuilder>
Title: Issue with ACL implementation for Multiple Entity Subtypes in `hook_civicrm_selectWhereClause`
ThreadText: # Issue with ACL implementation for Multiple Entity Subtypes in `hook_civicrm_selectWhereClause`
  
  (Asked by: username_0 on 2024-12-02)
  
  We are using the hook_civicrm_selectWhereClause hook to apply ACLs (Access Control Lists) for the Eck_Collection_Camp entity. However, the current implementation only works for one subtype for particular custom group, and we are unable to differentiate other subtypes of same entity within the same hook. This limitation arises because we do not receive any unique identifier in the parameters to differentiate between subtypes.
  Current Implementation:
  In the existing code, we apply ACL checks for the Eck_Collection_Camp entity as follows:
  public static function aclCollectionCamp(string $entity, array &$clauses, int $userId, array $conditions) {
      if ($entity !== 'Eck_Collection_Camp') {
          return FALSE;
      }
  ......
  ....
  
  }
  
  This works fine for one entity subtype (Eck_Collection_Camp), but does not account for other subtypes.
  Does someone knows how we can fis this issue?
  
  **Tags:** webform-civicrm, civicrm-entity, formbuilder
  
  > **Comments:**
  > **username_1**: I think you are using the entity construction kit to create your entity, based on the name, but you haven't said anything else about it (e.g. you don't mention what type it's a collection camp of?). This question is kind of impossible to answer, a bit too much in the weeds ...  
  > **username_2**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
  
  ---
  
  ## 0 answers
  
  