• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/onlyoffice/restrictionmanager.php
  • Класс: BitrixDiskDocumentOnlyOfficeRestrictionManager
  • Вызов: RestrictionManager::isAllowedEdit
public function isAllowedEdit(string $documentKey, int $userId): bool
{
	$limit = $this->getLimit();
	if ($limit === self::UNLIMITED_VALUE)
	{
		return true;
	}

	$countSessions = $this->countSessions();
	if ($this->isEnoughToDeletePendingUsages($limit, $countSessions))
	{
		$this->addJobToCleanPendingUsages();
	}

	if ($limit > $countSessions)
	{
		return true;
	}

	if ($this->existsSession($documentKey, $userId))
	{
		return true;
	}

	return false;
}