From 93f311d7bf4d935196347112fb4b415612f75fb3 Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Fri, 7 Aug 2015 17:14:29 -0400 Subject: [PATCH] CRM-16981 - Fix MailingACLIDs to only show mailings a user has access to for Joomla/WP --- CRM/Mailing/BAO/Mailing.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index b7ebdc163c..408eaf37f3 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -2400,7 +2400,15 @@ ORDER BY civicrm_email.is_bulkmail DESC // get all the groups that this user can access // if they dont have universal access - $groups = CRM_Core_PseudoConstant::group(NULL, FALSE); + $groupNames = civicrm_api3('Group', 'get', array( + 'is_active' => 1, + 'check_permissions' => TRUE, + 'return' => array('title', 'id'), + 'options' => array('limit' => 0), + )); + foreach ($groupNames['values'] as $group) { + $groups[$group['id']] = $group['title']; + } if (!empty($groups)) { $groupIDs = implode(',', array_keys($groups)); -- 2.25.1