]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not automatically add "update" permission to shared mounts
authorVincent Petry <pvince81@owncloud.com>
Fri, 20 Mar 2015 11:33:59 +0000 (12:33 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 20 Mar 2015 11:33:59 +0000 (12:33 +0100)
In the past it seems the update permission was needed to be able to
rename shared mounts, but it doesn't seem to be the case any more.

Removing the "update" permission that used to be added automatically
fixes the read-only permission check when trying to overwrite a
read-only file over WebDAV.

apps/files_sharing/tests/sharedstorage.php
lib/private/files/view.php

index 2959b9aacfb1822fa3d520b8d6b4a746a45f34a5..46f75b488b50b4cb73b02f729c8f6f981be1632e 100644 (file)
@@ -182,9 +182,8 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
                // for the share root we expect:
                // the shared permissions (1)
                // the delete permission (8), to enable unshare
-               // the update permission (2), to allow renaming of the mount point
                $rootInfo = \OC\Files\Filesystem::getFileInfo($this->folder);
-               $this->assertSame(11, $rootInfo->getPermissions());
+               $this->assertSame(9, $rootInfo->getPermissions());
 
                // for the file within the shared folder we expect:
                // the shared permissions (1)
index 53e13396621f51e1c9799f866d4edc776d7ea16a..c95e054581039f0de4b9c0bf9f27b18298932289 100644 (file)
@@ -1133,7 +1133,7 @@ class View {
                }
 
                if ($mount instanceof MoveableMount && $internalPath === '') {
-                       $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE;
+                       $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
                }
 
                $data = \OC_FileProxy::runPostProxies('getFileInfo', $path, $data);