return $showItem;
}
}
- // CRM-17310 my reports allow people with access own reports to see the report if it is theirs.
- elseif ($key == 'access own private reports') {
- // Special permission processing for private reports.
- $report_url = parse_url(ltrim($url, '/'));
- $instance_id = CRM_Report_Utils_Report::getInstanceID($report_url['path']);
- $hasPermission = $showItem = CRM_Report_BAO_ReportInstance::contactIsOwner($instance_id);
- }
else {
$hasPermission = TRUE;
}
}
}
+ // Special permissions check for private instance if it's not the current contact instance
+ if (CRM_Report_BAO_ReportInstance::reportIsPrivate($this->_id) &&
+ !CRM_Report_BAO_ReportInstance::contactIsOwner($this->_id)) {
+ if (!CRM_Core_Permission::check('access all private reports')) {
+ $this->_instanceForm = FALSE;
+ $this->assign('criteriaForm', FALSE);
+ }
+ }
+
$this->_instanceButtonName = $this->getButtonName('submit', 'save');
$this->_createNewButtonName = $this->getButtonName('submit', 'next');
$this->_printButtonName = $this->getButtonName('submit', 'print');
// it seems to be not set at all if unchecked.
if (!empty($formValues['add_to_my_reports'])) {
$params['owner_id'] = CRM_Core_Session::singleton()->getLoggedInContactID();
- $params['permission'] = 'access own private reports';
- $params['grouprole'] = array();
}
else {
$params['owner_id'] = 'null';
ts('access Report Criteria'),
ts('Change report search criteria'),
),
- 'access own private reports' => array(
- ts('access own private reports'),
- ts('Access reports owned by the contact'),
- ),
- 'access all private reports' => array(
- ts('access all private reports'),
- ts('Access all private reports'),
+ 'administer private reports' => array(
+ ts('administer private reports'),
+ ts('Edit all private reports'),
),
'administer reserved reports' => array(
ts('administer reserved reports'),