diff --git a/datamodels/2.x/itop-portal-base/portal/src/helpers/securityhelper.class.inc.php b/datamodels/2.x/itop-portal-base/portal/src/helpers/securityhelper.class.inc.php index 91384d4114..ca3fdf8bf2 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/helpers/securityhelper.class.inc.php +++ b/datamodels/2.x/itop-portal-base/portal/src/helpers/securityhelper.class.inc.php @@ -1,6 +1,6 @@ GetScopeFilterForProfiles(UserRights::ListProfiles(), $sObjectClass, $sScopeAction); if ($oScopeQuery === null) { @@ -94,34 +94,17 @@ class SecurityHelper $aQueryParams['object_id'] = $sObjectId; $oScopeQuery->SetInternalParams($aQueryParams); unset($aQueryParams); - } - // - Checking if query result is null - $oSet = new DBObjectSet($oScopeQuery); - // Note : This is to address a bug (#R-011452). We creating an object that is the first of its class, this would failed as the scope query always return an empty set - //if ($oSet->Count() === 0) - if (($oSet->Count() === 0) && ($sObjectId !== null)) - { - if ($oApp['debug']) - { - IssueLog::Info($sDebugTracePrefix . ' as there was no result for the following scope query : ' . $oScopeQuery->ToOQL(true)); - } - return false; - } - - // Checking if the cmdbAbstractObject exists if id is specified - if ($sObjectId !== null) - { - $oObject = MetaModel::GetObject($sObjectClass, $sObjectId, false /* MustBeFound */, $oApp['scope_validator']->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjectClass)); - if ($oObject === null) - { - if ($oApp['debug']) - { - IssueLog::Info($sDebugTracePrefix . ' as object doesn\'t exists'); - } - return false; - } - unset($oObject); + // - Checking if query result is null + $oSet = new DBObjectSet($oScopeQuery); + if ($oSet->Count() === 0) + { + if ($oApp['debug']) + { + IssueLog::Info($sDebugTracePrefix . ' as there was no result for the following scope query : ' . $oScopeQuery->ToOQL(true)); + } + return false; + } } } @@ -147,5 +130,3 @@ class SecurityHelper } } - -?> \ No newline at end of file