Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add required $message parameter
  • Loading branch information
LukasReschke committed Jun 30, 2016
commit 54ab972f0e45d0c192a705d794f9f4db7397b6e8
4 changes: 2 additions & 2 deletions apps/dav/lib/Connector/Sabre/ObjectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function move($sourcePath, $destinationPath) {
$sourcePermission = $infoSource && $infoSource->isDeletable();

if (!$destinationPermission || !$sourcePermission) {
throw new Forbidden();
throw new Forbidden('No permissions to move object.');
}

$targetNodeExists = $this->nodeExists($destinationPath);
Expand Down Expand Up @@ -285,7 +285,7 @@ public function copy($source, $destination) {

$info = $this->fileView->getFileInfo(dirname($destination));
if ($info && !$info->isUpdateable()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might not be 100% correct. A copy needs create permissions for a "copy in" as new file.
As for "copy + overwrite" it's "create + delete", because SabreDAV will trigger an automatic delete of the target before running this method. So in the end only a check on "create" is needed.

Even though the "update" permission semantically seems to fit better for overwrites, it never quite worked as expected.

throw new Forbidden();
throw new Forbidden('No permissions to move object.');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"copy" in this case? 😉

}

// this will trigger existence check
Expand Down