CRM-15854 - MailingAB API - Restrict to 'access CiviMail'
authorTim Otten <totten@civicrm.org>
Wed, 4 Mar 2015 00:10:41 +0000 (16:10 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 4 Mar 2015 00:12:03 +0000 (16:12 -0800)
We haven't thought through how it would work with workflow-based
permissions.

CRM/Core/DAO/permissions.php

index 295c82566e90df25f24aa9ec7f66950c6ff31406..dcc5f18d5168469d3835f2daf5c1d0d86eb596a0 100644 (file)
@@ -265,11 +265,30 @@ function _civicrm_api3_permissions($entity, $action, &$params) {
       $civiMailBasePerms,
     ),
   );
-  $permissions['mailing_a_b'] = $permissions['mailing'];
   $permissions['mailing_group'] = $permissions['mailing'];
   $permissions['mailing_job'] = $permissions['mailing'];
   $permissions['mailing_recipients'] = $permissions['mailing'];
 
+  $permissions['mailing_a_b'] = array(
+    'get' => array(
+      'access CiviCRM',
+      'access CiviMail',
+    ),
+    'delete' => array(
+      'access CiviCRM',
+      'access CiviMail',
+      'delete in CiviMail',
+    ),
+    'submit' => array(
+      'access CiviCRM',
+      array('access CiviMail', 'schedule mailings'),
+    ),
+    'default' => array(
+      'access CiviCRM',
+      'access CiviMail',
+    ),
+  );
+
   // Membership permissions
   $permissions['membership'] = array(
     'get' => array(