• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/rest.php
  • Класс: BitrixTimemanRest
  • Вызов: Rest::getUserInstance
static function getUserInstance(array $query)
{
	global $USER;

	if(array_key_exists('USER_ID', $query) && $query['USER_ID'] != $USER->getId())
	{
		if(!CTimeMan::isAdmin())
		{
			throw new AccessException('User does not have access to managing other users work time');
		}

		if(!static::checkUser($query['USER_ID']))
		{
			throw new ObjectNotFoundException('User not found');
		}

		return new CTimeManUser($query['USER_ID']);
	}
	else
	{
		return CTimeManUser::instance();
	}
}