From: Coleman Watts Date: Thu, 21 Jan 2016 22:01:49 +0000 (-0500) Subject: Permissions code cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=49c5f9092c93494f63e20d11f0309da8dd3021da;p=civicrm-core.git Permissions code cleanup --- diff --git a/CRM/Core/DAO/permissions.php b/CRM/Core/DAO/permissions.php index e9a9ffca85..f63519d4ab 100644 --- a/CRM/Core/DAO/permissions.php +++ b/CRM/Core/DAO/permissions.php @@ -196,9 +196,10 @@ function _civicrm_api3_permissions($entity, $action, &$params) { // Campaign permissions $permissions['campaign'] = array( 'get' => array('access CiviCRM'), - 'create' => array(array('administer CiviCampaign', 'manage campaign')), - 'update' => array(array('administer CiviCampaign', 'manage campaign')), - 'delete' => array(array('administer CiviCampaign', 'manage campaign')), + 'default' => array( + // nested array = OR + array('administer CiviCampaign', 'manage campaign') + ), ); $permissions['survey'] = $permissions['campaign']; @@ -570,7 +571,7 @@ function _civicrm_api3_permissions($entity, $action, &$params) { if ($action == 'replace' || $snippet == 'del') { // 'Replace' is a combination of get+create+update+delete; however, the permissions // on each of those will be tested separately at runtime. This is just a sniff-test - // based on the heuristic that 'delete' tends to be the most closesly guarded + // based on the heuristic that 'delete' tends to be the most closely guarded // of the necessary permissions. $action = 'delete'; }