]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix permision mask
authorRoeland Jago Douma <roeland@famdouma.nl>
Sat, 22 Oct 2016 19:29:14 +0000 (21:29 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 24 Oct 2016 19:45:00 +0000 (21:45 +0200)
If we move a file from the temp part file to the original file we don't
need update permissions.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Files/Sharing/FilesDropPlugin.php [new file with mode: 0644]
lib/private/Files/Storage/Wrapper/PermissionsMask.php

diff --git a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
new file mode 100644 (file)
index 0000000..e69de29
index 39375602c3436f839f69e44c495c67534c2d04cd..7bcb1087fefbafaaca7d13645aa5ad39da28eb17 100644 (file)
@@ -78,6 +78,14 @@ class PermissionsMask extends Wrapper {
        }
 
        public function rename($path1, $path2) {
+               $p = strpos($path1, $path2);
+               if ($p === 0) {
+                       $part = substr($path1, strlen($path2));
+                       //This is a rename of the transfer file to the original file
+                       if (strpos($part, '.ocTransferId') === 0) {
+                               return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($path1, $path2);
+                       }
+               }
                return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($path1, $path2);
        }