Portal: Fix missing parameter in new ScopeValidatorHelper::AddScopeToQuery() method. "Read" scope was always applied!

SVN:trunk[5872]
This commit is contained in:
Guillaume Lajarige
2018-06-14 14:38:48 +00:00
parent 189cefac1b
commit 5b3d7e2354

View File

@@ -553,14 +553,17 @@ class ScopeValidatorHelper
}
/**
* Add the scope query (view or edit depending on $sAction) for $sClass to the $oQuery.
*
* @param DBSearch $oQuery
* @param string $sClass
* @param string $sAction
*
* @return bool true if scope exists, false if scope is null
*/
public function AddScopeToQuery(DBSearch &$oQuery, $sClass)
public function AddScopeToQuery(DBSearch &$oQuery, $sClass, $sAction = UR_ACTION_READ)
{
$oScopeQuery = $this->GetScopeFilterForProfiles(UserRights::ListProfiles(), $sClass, UR_ACTION_READ);
$oScopeQuery = $this->GetScopeFilterForProfiles(UserRights::ListProfiles(), $sClass, $sAction);
if ($oScopeQuery !== null)
{
$oQuery = $oQuery->Intersect($oScopeQuery);