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

Fixed permission issue on search pages

parent dd86c825
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,20 @@ abstract class CRM_Dataprocessor_Form_Output_AbstractUIOutputForm extends CRM_Co
$this->assign('has_exposed_filters', $this->hasExposedFilters());
}
/**
* Check whether the user has access to the output.
*
* @return bool
*/
protected function checkPermission() {
if (isset($this->dataProcessorOutput['permission']) && $this->dataProcessorOutput['permission']) {
if (!CRM_Core_Permission::check(array($this->dataProcessorOutput['permission']))) {
return false;
}
}
return true;
}
/**
* Retrieve the data processor and the output configuration
*
......@@ -83,7 +97,10 @@ abstract class CRM_Dataprocessor_Form_Output_AbstractUIOutputForm extends CRM_Co
$this->dataProcessorOutput = civicrm_api3('DataProcessorOutput', 'getsingle', array('id' => $dao->output_id));
$this->assign('output', $this->dataProcessorOutput);
if (!$this->isConfigurationValid()) {
if (!$this->checkPermission()) {
CRM_Utils_System::permissionDenied();
CRM_Utils_System::civiExit();
} elseif (!$this->isConfigurationValid()) {
throw new \Exception('Invalid configuration found of the data processor "' . $dataProcessorName . '"');
}
}
......@@ -184,5 +201,4 @@ abstract class CRM_Dataprocessor_Form_Output_AbstractUIOutputForm extends CRM_Co
protected function getCriteriaElementSize() {
return 'full';
}
}
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