From dc15bb38fcf597dbd6b24625423f087de21c6937 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Mon, 21 Sep 2015 20:09:14 +0530 Subject: [PATCH] Revert CRM-17067 fix ---------------------------------------- * CRM-17067: New relationship permission enforcement has result to related membership not created via public pages https://issues.civicrm.org/jira/browse/CRM-17067 --- CRM/Contact/BAO/Relationship.php | 4 +--- CRM/Member/BAO/Membership.php | 4 ++-- api/v3/Relationship.php | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index e89d703fc3..9eec868793 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -1159,7 +1159,6 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) $count = 0, $relationshipId = 0, $links = NULL, $permissionMask = NULL, $permissionedContact = FALSE, - $action = CRM_Core_Action::BROWSE, $params = array() ) { $values = array(); @@ -1233,8 +1232,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) while ($relationship->fetch()) { $rid = $relationship->civicrm_relationship_id; $cid = $relationship->civicrm_contact_id; - if (($action & CRM_Core_Action::BROWSE) && - $permissionedContact && + if ($permissionedContact && (!CRM_Contact_BAO_Contact_Permission::relationship($cid, $contactId)) ) { continue; diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 71118a61b7..8fd061802b 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -457,11 +457,11 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { $relationships = array(); if (isset($membershipType['relationship_type_id'])) { $relationships = CRM_Contact_BAO_Relationship::getRelationship($contactId, - CRM_Contact_BAO_Relationship::CURRENT, NULL, NULL, NULL, NULL, NULL, FALSE, $action + CRM_Contact_BAO_Relationship::CURRENT ); if ($action & CRM_Core_Action::UPDATE) { $pastRelationships = CRM_Contact_BAO_Relationship::getRelationship($contactId, - CRM_Contact_BAO_Relationship::PAST, NULL, NULL, NULL, NULL, NULL, FALSE, $action + CRM_Contact_BAO_Relationship::PAST ); $relationships = array_merge($relationships, $pastRelationships); } diff --git a/api/v3/Relationship.php b/api/v3/Relationship.php index 785f4e03d6..71f84029c3 100644 --- a/api/v3/Relationship.php +++ b/api/v3/Relationship.php @@ -116,7 +116,6 @@ function civicrm_api3_relationship_get($params) { NULL, NULL, FALSE, - NULL, $params ); } -- 2.25.1