• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/onlyoffice.php
  • Класс: BitrixDiskControllerOnlyOffice
  • Вызов: OnlyOffice::loadDocumentEditorAction
public function loadDocumentEditorAction(
	DiskFile $object = null,
	DiskAttachedObject $attachedObject = null,
	int $editorMode = DocumentOnlyOfficeEditorConfigBuilder::VISUAL_MODE_USUAL
): ?HttpResponse
{
	$canEdit = false;
	if ($attachedObject && !$attachedObject->canUpdate(User::resolveUserId($this->getCurrentUser())))
	{
		$attachedObject = null;
	}
	elseif ($attachedObject)
	{
		$canEdit = true;
	}

	if ($object && $attachedObject && ($object->getId() != $attachedObject->getObjectId()))
	{
		$object = null;
	}

	if ($object && !$canEdit)
	{
		$securityContext = $object->getStorage()->getCurrentUserSecurityContext();
		if ($object->canUpdate($securityContext))
		{
			$canEdit = true;
		}
	}

	if (!$canEdit)
	{
		return $this->showNotFoundPageAction();
	}

	return $this->loadDocumentEditor($object, null, $attachedObject, ModelsDocumentSession::TYPE_EDIT, $editorMode);
}