• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/helper.php
  • Класс: CBPHelper
  • Вызов: CBPHelper::checkUserSubordination
static function checkUserSubordination($headUserId, $subUserId)
{
	if (CModule::IncludeModule('intranet'))
	{
		$headUserId = (int)$headUserId;
		$subUserId = (int)$subUserId;

		if ($headUserId && $subUserId)
		{
			$headDepts = (array) CIntranetUtils::GetSubordinateDepartments($headUserId, true);
			if (!empty($headDepts))
			{
				$subDepts = (array) CIntranetUtils::GetUserDepartments($subUserId);
				return (sizeof(array_intersect($headDepts, $subDepts)) > 0);
			}
		}
	}
	return false;
}