/**
* Decide what permissions to check for an api call
- * The contact must have all of the returned permissions for the api call to be allowed
*
* @param $entity : (str) api entity
* @param $action : (str) api action
* * default: catch-all for anything not declared
*
* Note: some APIs declare other actions as well
+ *
+ * Permissions should use arrays for AND and arrays of arrays for OR
+ * @see CRM_Core_Permission::check for more documentation
*/
$permissions = array();
'delete in CiviCase',
),
'default' => array(
- // This is the minimum permission needed. Finer-grained access is controlled by CRM_Case_BAO_Case::addSelectWhereClause
- 'access my cases and activities',
+ // At minimum the user needs one of the following. Finer-grained access is controlled by CRM_Case_BAO_Case::addSelectWhereClause
+ array('access my cases and activities', 'access all cases and activities'),
),
);
$permissions['case_contact'] = $permissions['case'];
$permissions['case_type'] = array(
'default' => array('administer CiviCase'),
- 'get' => array('access my cases and activities'),
+ 'get' => array(
+ // nested array = OR
+ array('access my cases and activities', 'access all cases and activities'),
+ ),
);
// Campaign permissions