Skip to content

Commit

Permalink
Merge pull request #3448 from nextcloud/bugfix/noid/move-new-scope
Browse files Browse the repository at this point in the history
fix: Run move in lock scope of the user
  • Loading branch information
juliushaertl committed Jun 18, 2024
2 parents 80a3df4 + ef8ad6d commit f5b4b6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,13 @@ public function postFile(string $fileId, string $access_token): JSONResponse {

// create a unique new file
$path = $this->rootFolder->getNonExistingName($path);
$file = $file->move($path);
$this->lockManager->runInScope(new LockContext(
$this->getFileForWopiToken($wopi),
ILock::TYPE_APP,
Application::APPNAME
), function () use (&$file, $path) {
$file = $file->move($path);
});
} else {
$file = $this->getFileForWopiToken($wopi);

Expand Down

0 comments on commit f5b4b6a

Please sign in to comment.