From: Brian Shaughnessy Date: Thu, 9 May 2013 03:50:39 +0000 (-0400) Subject: CRM-12569 permission activity links and tasks more accurately X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bbfeec41209c9a7723dd93c0e84d13e9c29da1ac;p=civicrm-core.git CRM-12569 permission activity links and tasks more accurately --- diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index ff5c3c3d0c..0a92ca5b71 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -209,11 +209,13 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C elseif ($activityTypeName == 'Print PDF Letter') { $updateUrl = 'civicrm/activity/pdf/add'; } - $actionLinks += array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), - 'url' => $updateUrl, - 'qs' => $qsUpdate, - 'title' => ts('Update Activity'), - )); + if ( CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE) ) { + $actionLinks += array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), + 'url' => $updateUrl, + 'qs' => $qsUpdate, + 'title' => ts('Update Activity'), + )); + } } if ( diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index 09745c23d3..073cd0024a 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -110,10 +110,13 @@ class CRM_Activity_Task { $config = CRM_Core_Config::singleton(); if (in_array('CiviCase', $config->enableComponents)) { - self::$_tasks[6] = array('title' => ts('File on Case'), - 'class' => 'CRM_Activity_Form_Task_FileOnCase', - 'result' => FALSE, - ); + if ( CRM_Core_Permission::check('access all cases and activities') || + CRM_Core_Permission::check('access my cases and activities') ) { + self::$_tasks[6] = array('title' => ts('File on Case'), + 'class' => 'CRM_Activity_Form_Task_FileOnCase', + 'result' => FALSE, + ); + } } //CRM-4418, check for delete