From: Robin Appelman Date: Mon, 25 Aug 2014 12:06:27 +0000 (+0200) Subject: Check if the parent is writable to check if a file is deletable X-Git-Tag: v8.0.0alpha1~672^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ab79caf29bf4173e15f9dad00a206c6bb1f3999c;p=nextcloud-server.git Check if the parent is writable to check if a file is deletable --- diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 4799c865142..4680971b278 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -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) {