Documentation

setContextUserId

Rights::setContextUserId(
    $uid
);

Method sets user ID to be applied when handling site methods. This method doesn't change current user authorization and operates only at the current hit.

Parameters

Parameter Description Available from version
$uid User ID.

Example

if (\Bitrix\Main\Loader::includeModule('landing'))
{
   \Bitrix\Landing\Rights::setContextUserId(45);
}
© «Bitrix24», 2001-2024
Up