• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/file.php
  • Класс: BitrixDiskControllerFile
  • Вызов: File::restoreFromVersionAction
public function restoreFromVersionAction(DiskFile $file, DiskVersion $version)
{
	$securityContext = $file->getStorage()->getCurrentUserSecurityContext();
	if (!$file->canRestore($securityContext))
	{
		$this->addError(new Error(Loc::getMessage('DISK_ERROR_MESSAGE_DENIED')));

		return null;
	}

	if (!$file->restoreFromVersion($version, $this->getCurrentUser()->getId()))
	{
		$this->addErrors($file->getErrors());

		return null;
	}

	return $this->getAction($file);
}