From 76352fbcdfb59feccbc6c6d28227e0b8552e43a8 Mon Sep 17 00:00:00 2001 From: colemanw Date: Tue, 4 Aug 2015 08:42:27 -0400 Subject: [PATCH] Revert "CRM-16836 - Enforce permissions in group api getoptions" --- CRM/Contact/BAO/GroupContact.php | 13 ++++--------- CRM/Core/Form.php | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 2a564f3feb..d29b3267b5 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -799,15 +799,10 @@ AND contact_id IN ( $contactStr ) $options = CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context); - if (($fieldName == 'group' || $fieldName == 'group_id')) { - // Enforce group visibility permissions - if (!empty($props['check_permissions'])) { - $options = CRM_Core_PseudoConstant::group(); - } - if ($context == 'search' || $context == 'create') { - // Sort group list by hierarchy - $options = CRM_Contact_BAO_Group::getGroupsHierarchy($options, NULL, '- ', TRUE); - } + // Sort group list by hierarchy + // TODO: This will only work when api.entity is "group_contact". What about others? + if (($fieldName == 'group' || $fieldName == 'group_id') && ($context == 'search' || $context == 'create')) { + $options = CRM_Contact_BAO_Group::getGroupsHierarchy($options, NULL, '- ', TRUE); } return $options; diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 9b36db582d..042fb83cb1 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1061,7 +1061,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $options = $props['options']; } else { - $info = civicrm_api3($props['entity'], 'getoptions', $props + array('check_permissions' => 1)); + $info = civicrm_api3($props['entity'], 'getoptions', $props); $options = $info['values']; } if (!array_key_exists('placeholder', $props)) { -- 2.25.1