Skip to content
Snippets Groups Projects
Commit d17649da authored by Uma's avatar Uma
Browse files

Fixes #1262 Shared report should be accessible to admin user

parent facdabb4
No related branches found
No related tags found
No related merge requests found
......@@ -275,6 +275,9 @@ class Reports_Record_Model extends Vtiger_Record_Model {
function isRecordHasViewAccess($reportType){
$db = PearDatabase::getInstance();
$current_user = vglobal('current_user');
if(strtolower($current_user->is_admin) == "on") {
return true;
}
$params = array();
$sql = ' SELECT vtiger_report.reportid,vtiger_report.reportname FROM vtiger_report ';
require('user_privileges/user_privileges_'.$current_user->id.'.php');
......@@ -305,6 +308,8 @@ class Reports_Record_Model extends Vtiger_Record_Model {
$queryObj = Reports::getReportSharingQuery($queryObj,$reportType);
$sql = $queryObj->query. ' AND vtiger_report.reportid = '.$this->getId();
$params = $queryObj->queryParams;
echo "<pre>";
print_r($db->convert2Sql($sql,$params));
$result = $db->pquery($sql,$params);
return $db->num_rows($result) > 0 ? true:false;
}
......
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