Skip to content

Commit

Permalink
Fix: Race condition on newly created files (import vs. oo)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke- committed Jul 29, 2021
1 parent 48ffe67 commit 379a8d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Changelog
=========

0.13.1 - Unreleased
----------------------
0.13.1 - July 29, 2021
-----------------------
- Enh #114: Fix for PHP8 - Deprecate required parameters after optional parameters
- Fix #117: CLI error when no REST module is installed
- Fix: Race condition on newly created files (import vs. oo)
- Enh: Updated translations


0.13.0 - April 9, 2021
----------------------
Expand Down
7 changes: 6 additions & 1 deletion models/FileSystemItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,16 @@ public static function getItemById($itemId)

public function canEdit(User $user)
{
// Fixes race condition on newly created files (import vs. onlyoffice)
if ($this->content->container === null && $this->content->isNewRecord) {
return true;
}

if ($this->content->container->permissionManager->can(new ManageFiles())) {
return true;
}

return false;
}

}
}

0 comments on commit 379a8d5

Please sign in to comment.