mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°1248 - Fix API access (back to the same behavior as 2.4.1)
SVN:trunk[5705]
This commit is contained in:
@@ -559,6 +559,7 @@ interface iSelfRegister
|
|||||||
*/
|
*/
|
||||||
class UserRights
|
class UserRights
|
||||||
{
|
{
|
||||||
|
/** @var UserRightsAddOnAPI $m_oAddOn */
|
||||||
protected static $m_oAddOn;
|
protected static $m_oAddOn;
|
||||||
protected static $m_oUser;
|
protected static $m_oUser;
|
||||||
protected static $m_oRealUser;
|
protected static $m_oRealUser;
|
||||||
@@ -959,20 +960,32 @@ class UserRights
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $sClass
|
||||||
|
* @param array $aSettings
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public static function GetSelectFilter($sClass, $aSettings = array())
|
public static function GetSelectFilter($sClass, $aSettings = array())
|
||||||
{
|
{
|
||||||
// When initializing, we need to let everything pass trough
|
// When initializing, we need to let everything pass trough
|
||||||
if (!self::CheckLogin()) return true;
|
if (!self::CheckLogin()) {return true;}
|
||||||
|
|
||||||
if (self::IsAdministrator()) return true;
|
if (self::IsAdministrator()) {return true;}
|
||||||
|
|
||||||
if (MetaModel::HasCategory($sClass, 'bizmodel') || MetaModel::HasCategory($sClass, 'grant_by_profile'))
|
try
|
||||||
{
|
{
|
||||||
return self::$m_oAddOn->GetSelectFilter(self::$m_oUser, $sClass, $aSettings);
|
if (MetaModel::HasCategory($sClass, 'bizmodel'))
|
||||||
}
|
{
|
||||||
else
|
return self::$m_oAddOn->GetSelectFilter(self::$m_oUser, $sClass, $aSettings);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception $e)
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user