]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "fix permissions of mountpoints - take 2" 4883/head
authorMorris Jobke <hey@morrisjobke.de>
Mon, 15 May 2017 17:43:25 +0000 (12:43 -0500)
committerGitHub <noreply@github.com>
Mon, 15 May 2017 17:43:25 +0000 (12:43 -0500)
apps/files_sharing/tests/SharedStorageTest.php
lib/private/Files/View.php

index 195016c47d119c3550acd113600038a3a9651f90..7d007cb64140977995527036ac68acf3348887bc 100644 (file)
@@ -207,11 +207,10 @@ class SharedStorageTest extends TestCase {
                $this->assertTrue(\OC\Files\Filesystem::is_dir($this->folder));
 
                // for the share root we expect:
-               // the read permissions
-               // the delete permission, to enable unshare
-               // the update permission, to enable moving the share
+               // the read permissions (1)
+               // the delete permission (8), to enable unshare
                $rootInfo = \OC\Files\Filesystem::getFileInfo($this->folder);
-               $this->assertSame(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE, $rootInfo->getPermissions());
+               $this->assertSame(9, $rootInfo->getPermissions());
 
                // for the file within the shared folder we expect:
                // the read permissions (1)
index 18942d05acf667e91d2d92693328b517ad2a2848..0e22415e6f735a6de31b0534b81946e330886f27 100644 (file)
@@ -1355,12 +1355,8 @@ class View {
                                return false;
                        }
 
-                       if ($internalPath === '') {
-                               if ($mount instanceof MoveableMount) {
-                                       $data['permissions'] = $data['permissions'] | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE;
-                               } else {
-                                       $data['permissions'] = $data['permissions'] & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE));
-                               }
+                       if ($mount instanceof MoveableMount && $internalPath === '') {
+                               $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
                        }
 
                        $owner = $this->getUserObjectForOwner($storage->getOwner($internalPath));