• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documentcontroller.php
  • Класс: BitrixDiskDocumentDocumentController
  • Вызов: DocumentController::getDocumentHandlerForSession
private function getDocumentHandlerForSession(EditSession $session)
{
	if($session->getOwnerId() == $session->getUserId())
	{
		return $this->documentHandler;
	}

	$documentHandlersManager = Driver::getInstance()->getDocumentHandlersManager();
	$documentHandler = $documentHandlersManager->getHandlerByCode($session->getService());

	if(!$documentHandler)
	{
		$this->errorCollection->add($documentHandlersManager->getErrors());

		return null;
	}

	$documentHandler->setUserId($session->getOwnerId());
	if(!$documentHandler->queryAccessToken()->hasAccessToken())
	{
		$this->errorCollection[] = new Error('Could not get token for other user.');

		return null;
	}

	return $documentHandler;
}