]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if the parent is writable to check if a file is deletable
authorRobin Appelman <icewind@owncloud.com>
Mon, 25 Aug 2014 12:06:27 +0000 (14:06 +0200)
committerLukas Reschke <lukas@owncloud.com>
Wed, 17 Sep 2014 09:35:16 +0000 (11:35 +0200)
lib/private/files/storage/common.php

index 4799c86514236920b12e3d00fdb96006298f92ac..4680971b278c42007cd0bb376cd5edcad95954fd 100644 (file)
@@ -95,7 +95,11 @@ abstract class Common implements \OC\Files\Storage\Storage {
        }
 
        public function isDeletable($path) {
-               return $this->isUpdatable($path);
+               if ($path === '' or $path === '/') {
+                       return false;
+               }
+               $parent = dirname($path);
+               return $this->isUpdatable($parent);
        }
 
        public function isSharable($path) {