• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/file.php
  • Класс: BitrixDiskControllerFile
  • Вызов: File::unlockAction
public function unlockAction(DiskFile $file)
{
	if (!Configuration::isEnabledObjectLock())
	{
		$this->addError(new Error('Could not unlock. Feature is disabled in modules settings.'));

		return null;
	}

	$securityContext = $file->getStorage()->getCurrentUserSecurityContext();
	if (!$file->canUnlock($securityContext))
	{
		$this->addError(new Error('Could not unlock due to lack of rights.'));

		return null;
	}

	if (!$file->unlock($this->getCurrentUser()->getId()))
	{
		$this->addErrors($file->getErrors());

		return null;
	}

	return [
		'unlock' => null,
	];
}