N°5168 - Fix error message "Call to a member function GetKey() on null"

This commit is contained in:
acognet
2022-05-24 10:48:36 +02:00
parent f9a1f68295
commit 72f498a63b

View File

@@ -104,7 +104,7 @@ class SecurityHelper
}
// Forcing allowed writing on the object if necessary. This is used in some particular cases.
$bObjectIsCurrentUser = ($sObjectClass === 'Person' && $this->oObject->GetKey() == UserRights::GetContactId());
$bObjectIsCurrentUser = ($sObjectClass === 'Person' && $sObjectId == UserRights::GetContactId());
if(in_array($sAction , array(UR_ACTION_MODIFY, UR_ACTION_READ)) && $bObjectIsCurrentUser){
return true;
}