diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 760ee908628..be2aee01751 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -164,9 +164,11 @@ public function create(?int $fileId = null, ?string $filePath = null, ?string $b $lockInfo = null; } - $isLocked = $this->documentService->lock($file->getId()); - if (!$isLocked) { - $readOnly = true; + if (!$readOnly) { + $isLocked = $this->documentService->lock($file->getId()); + if (!$isLocked) { + $readOnly = true; + } } return new DataResponse([