Skip to content

Commit c4d74c4

Browse files
committed
N°8606 - Check user permissions in search operation of ajax.render.php
1 parent 9fca81c commit c4d74c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sources/Controller/AjaxRenderController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
use ScalarExpression;
4343
use SetupUtils;
4444
use UILinksWidget;
45+
use UserRights;
4546
use utils;
4647
use WizardHelper;
4748

@@ -71,6 +72,12 @@ public static function GetDataForTable(DBObjectSet $oSet, array $aClassAliases,
7172
$bShowObsoleteData = utils::ShowObsoleteData();
7273
}
7374
$oSet->SetShowObsoleteData($bShowObsoleteData);
75+
76+
// N°8606 : Check user permissions on the main class
77+
if (!UserRights::IsActionAllowed($oSet->GetClass(), UR_ACTION_READ, $oSet) == UR_ALLOWED_YES) {
78+
throw new Exception(Dict::Format('UI:Error:ReadNotAllowedOn_Class', $oSet->GetClass()));
79+
}
80+
7481
$aResult["draw"] = $iDrawNumber;
7582
$aResult["recordsTotal"] = $oSet->Count();
7683
$aResult["recordsFiltered"] = $aResult["recordsTotal"] ;
@@ -95,6 +102,11 @@ public static function GetDataForTable(DBObjectSet $oSet, array $aClassAliases,
95102
continue;
96103
}
97104

105+
// N°8606 : Check user permissions on the current class
106+
if (!UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES) {
107+
throw new Exception(Dict::Format('UI:Error:ReadNotAllowedOn_Class', $sClass));
108+
}
109+
98110
foreach ($aColumnsLoad[$sAlias] as $sAttCode) {
99111
$aObj[$sAlias."/".$sAttCode] = $aObject[$sAlias]->GetAsHTML($sAttCode);
100112
$bExcludeRawValue = false;

0 commit comments

Comments
 (0)