Merge pull request #23939 from civicrm/5.51
[civicrm-core.git] / CRM / Core / BAO / CustomValue.php
index 44b3d296aa265b6b115aea021cf6cdfac874bdd3..c88c62bfebd78922f3335cc67ff9d3ce8f073856 100644 (file)
@@ -260,7 +260,7 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO {
     }
 
     // Do we have access to the target record?
-    if (in_array($extends, ['Contact', 'Individual', 'Organization', 'Household'])) {
+    if ($extends === 'Contact' || in_array($extends, CRM_Contact_BAO_ContactType::basicTypes(TRUE), TRUE)) {
       return \Civi\Api4\Utils\CoreUtil::checkAccessDelegated('Contact', 'update', ['id' => $eid], $userID);
     }
     elseif (\Civi\Api4\Utils\CoreUtil::getApiClass($extends)) {