CRM-16490: allow all permissioned organization for on-behalf registration
[civicrm-core.git] / CRM / Core / Page / AJAX / Location.php
index 50473b6dbba3bc5f1906020ea240bba9b37500e7..b0d13d58bc2fc355c8affba6f309c89652455002 100644 (file)
@@ -58,11 +58,8 @@ class CRM_Core_Page_AJAX_Location {
     }
 
     // Verify user permission on related contact
-    $employers = CRM_Contact_BAO_Relationship::getPermissionedContacts(
-      $user,
-      CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b')
-    );
-    if (!isset($employers[$cid])) {
+    $organizations = CRM_Contact_BAO_Relationship::getPermissionedContacts($user, NULL, NULL, 'Organization');
+    if (!isset($organizations[$cid])) {
       CRM_Utils_System::civiExit();
     }