N°3377 - Allow to get data of current user - Fix Exception when using :current_user->... for non admin users

This commit is contained in:
acognet
2020-10-15 17:31:25 +02:00
parent 75ebecddd5
commit 557b9be795

View File

@@ -4223,6 +4223,7 @@ abstract class MetaModel
if (count($aCurrentUser) > 0)
{
$oSearch = DBObjectSearch::FromOQL("SELECT User WHERE id = :id");
$oSearch->AllowAllData();
$oSet = new DBObjectSet($oSearch, array(), array('id' => UserRights::GetUserId()));
$oSet->OptimizeColumnLoad($aCurrentUser);
$oUser = $oSet->fetch();