diff --git a/trunk/addons/userrights/userrightsmatrix.class.inc.php b/trunk/addons/userrights/userrightsmatrix.class.inc.php index 08b9eab17..87a61946b 100644 --- a/trunk/addons/userrights/userrightsmatrix.class.inc.php +++ b/trunk/addons/userrights/userrightsmatrix.class.inc.php @@ -425,6 +425,10 @@ class UserRightsMatrix extends UserRightsAddOnAPI } return $iRetCode; } + + public function FlushPrivileges() + { + } } UserRights::SelectModule('UserRightsMatrix'); diff --git a/trunk/addons/userrights/userrightsnull.class.inc.php b/trunk/addons/userrights/userrightsnull.class.inc.php index 981ef8ccf..da3f35548 100644 --- a/trunk/addons/userrights/userrightsnull.class.inc.php +++ b/trunk/addons/userrights/userrightsnull.class.inc.php @@ -73,6 +73,10 @@ class UserRightsNull extends UserRightsAddOnAPI { return UR_ALLOWED_YES; } + + public static function FlushPrivileges() + { + } } UserRights::SelectModule('UserRightsNull'); diff --git a/trunk/addons/userrights/userrightsprofile.class.inc.php b/trunk/addons/userrights/userrightsprofile.class.inc.php index 9edf1b153..c12214066 100644 --- a/trunk/addons/userrights/userrightsprofile.class.inc.php +++ b/trunk/addons/userrights/userrightsprofile.class.inc.php @@ -123,6 +123,9 @@ class URP_Users extends UserRightsBaseClass function DisplayBareRelations(web_page $oPage) { + // We may have just added a user, then we have to reset any existing cache + UserRights::FlushPrivileges(); + parent::DisplayBareRelations($oPage); $oPage->SetCurrentTabContainer('Related Objects'); @@ -232,6 +235,9 @@ class URP_Profiles extends UserRightsBaseClass function DisplayBareRelations(web_page $oPage) { + // We may have just added a user, then we have to reset any existing cache + UserRights::FlushPrivileges(); + parent::DisplayBareRelations($oPage); $oPage->SetCurrentTabContainer('Related Objects'); @@ -1293,6 +1299,11 @@ exit; $this->m_aMatchingProfiles[$iUser][$sClass][$iObjectRef] = $aRes; return $aRes; } + + public function FlushPrivileges() + { + $this->CacheData(); + } } // @@ -1614,7 +1625,6 @@ class SetupITILProfiles } } - public static function DoCreateProfiles() { self::DoCreateAdminProfile(); diff --git a/trunk/core/userrights.class.inc.php b/trunk/core/userrights.class.inc.php index d3071333b..e6107fdc8 100644 --- a/trunk/core/userrights.class.inc.php +++ b/trunk/core/userrights.class.inc.php @@ -56,6 +56,7 @@ abstract class UserRightsAddOnAPI abstract public function IsStimulusAllowed($iUserId, $sClass, $sStimulusCode, /*dbObjectSet*/ $oInstanceSet = null); abstract public function IsActionAllowedOnAttribute($iUserId, $sClass, $sAttCode, $iActionCode, /*dbObjectSet*/ $oInstanceSet = null); abstract public function IsAdministrator($iUserId); + abstract public function FlushPrivileges(); } @@ -269,6 +270,12 @@ class UserRights return self::$m_oAddOn->IsAdministrator($iUserId); } } + + public static function FlushPrivileges() + { + return self::$m_oAddOn->FlushPrivileges(); + } + }