APIv4 - skip acl clause for 1-1 custom fields
authorColeman Watts <coleman@civicrm.org>
Tue, 26 May 2020 13:26:26 +0000 (09:26 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 26 May 2020 13:26:26 +0000 (09:26 -0400)
Civi/Api4/Service/Schema/Joiner.php

index 6b66c57f986ba482581d6ab997ec69905005782e..4bd59de1715015b4a1749ca52e1658f066f7f449 100644 (file)
@@ -61,10 +61,11 @@ class Joiner {
       $target = $link->getTargetTable();
       $alias = $link->getAlias();
       $bao = \CRM_Core_DAO_AllCoreTables::getBAOClassName(\CRM_Core_DAO_AllCoreTables::getClassForTable($target));
-      $conditions = array_merge(
-        $link->getConditionsForJoin($baseTable),
-        $query->getAclClause($alias, $bao, explode('.', $joinPath))
-      );
+      $conditions = $link->getConditionsForJoin($baseTable);
+      // Custom fields do not have a bao, and currently do not have field-specific ACLs
+      if ($bao) {
+        $conditions = array_merge($conditions, $query->getAclClause($alias, $bao, explode('.', $joinPath)));
+      }
 
       $query->join($side, $target, $alias, $conditions);