From: Bob Silvern Date: Wed, 10 Aug 2016 00:34:15 +0000 (-0700) Subject: CRM-19201 - Report - Add support for reporting CiviCampaign activities. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d3e6c71f2ca4540f52cdfc9e80179162bad30885;p=civicrm-core.git CRM-19201 - Report - Add support for reporting CiviCampaign activities. ---------------------------------------- * CRM-19201: Cannot search CiviCampaign/CiviCase activities or report CiviCampaign activities https://issues.civicrm.org/jira/browse/CRM-19201 --- diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php index 7b06de4f37..2be48c2860 100644 --- a/CRM/Report/Form/Activity.php +++ b/CRM/Report/Form/Activity.php @@ -61,8 +61,24 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { $components = CRM_Core_Component::getEnabledComponents(); foreach ($components as $componentName => $componentInfo) { - $permission = sprintf("access %s", $componentName == 'CiviCase' ? "all cases and activities" : $componentName); - if (CRM_Core_Permission::check($permission)) { + // CRM-19201: Add support for reporting CiviCampaign activities + // "access all cases and activities" is used here rather than "access my + // cases and activities" to prevent those with only the later permission + // from seeing a list of all cases which might present a privacy issue. + switch ($componentName) { + case 'CiviCase': + $perm = "access all cases and activities"; + break; + + case 'CiviCampaign': + $perm = "administer $componentName"; + break; + + default: + $perm = "access $componentName"; + break; + } + if (CRM_Core_Permission::check($perm)) { $accessAllowed[] = $componentInfo->componentID; } }