}
// 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();
}