Skip to content
Snippets Groups Projects
Commit 4e0e26d2 authored by jaapjansma's avatar jaapjansma
Browse files

added right permission for form_processor_defaults api

parent 7811312b
No related branches found
No related tags found
No related merge requests found
......@@ -78,18 +78,18 @@ function form_processor_civicrm_alterAPIPermissions($entity, $action, &$params,
$permissions['form_processor_default_data_action']['converttitletoname'] = array('administer CiviCRM');
$permissions['form_processor_default_data_action']['validatename'] = array('administer CiviCRM');
if ($entity == 'form_processor' && !in_array($action, array('getactions', 'getfields'))) {
$permissions['form_processor'][$action] = array();
$formProcessorPermission = CRM_FormProcessor_BAO_FormProcessorInstance::getPermission($action);
if (!empty($formProcessorPermission)) {
$permissions['form_processor'][$action][] = $formProcessorPermission;
if (in_array($entity, array('form_processor', 'form_processor_defaults')) && $action != 'getactions') {
$formProcessName = $action;
if ($action == 'getfields' && isset($params['api_action'])) {
$formProcessName = $params['api_action'];
}
} elseif ($entity = 'form_processor' && $action == 'getfields' && isset($params['api_action'])) {
$permissions['form_processor'][$action] = array();
$formProcessorPermission = CRM_FormProcessor_BAO_FormProcessorInstance::getPermission($params['api_action']);
$permissions[$entity][$action] = array();
$formProcessorPermission = CRM_FormProcessor_BAO_FormProcessorInstance::getPermission($formProcessName);
if (!empty($formProcessorPermission)) {
$permissions['form_processor'][$action][] = $formProcessorPermission;
}
$permissions[$entity][$action][] = $formProcessorPermission;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment