mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
New profile: Portal User (and link from a ticket to the user portal)
SVN:trunk[801]
This commit is contained in:
@@ -62,6 +62,7 @@ abstract class UserRightsAddOnAPI
|
||||
abstract public function IsStimulusAllowed($oUser, $sClass, $sStimulusCode, /*dbObjectSet*/ $oInstanceSet = null);
|
||||
abstract public function IsActionAllowedOnAttribute($oUser, $sClass, $sAttCode, $iActionCode, /*dbObjectSet*/ $oInstanceSet = null);
|
||||
abstract public function IsAdministrator($oUser);
|
||||
abstract public function IsPortalUser($oUser);
|
||||
abstract public function FlushPrivileges();
|
||||
}
|
||||
|
||||
@@ -620,6 +621,23 @@ class UserRights
|
||||
return self::$m_aAdmins[$iUser];
|
||||
}
|
||||
|
||||
static $m_aPortalUsers = array();
|
||||
public static function IsPortalUser($oUser = null)
|
||||
{
|
||||
if (!self::CheckLogin()) return false;
|
||||
|
||||
if (is_null($oUser))
|
||||
{
|
||||
$oUser = self::$m_oUser;
|
||||
}
|
||||
$iUser = $oUser->GetKey();
|
||||
if (!isset(self::$m_aPortalUsers[$iUser]))
|
||||
{
|
||||
self::$m_aPortalUsers[$iUser] = self::$m_oAddOn->IsPortalUser($oUser);
|
||||
}
|
||||
return self::$m_aPortalUsers[$iUser];
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset cached data
|
||||
* @param Bool Reset admin cache as well
|
||||
|
||||
Reference in New Issue
Block a user