From ab79caf29bf4173e15f9dad00a206c6bb1f3999c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 25 Aug 2014 14:06:27 +0200 Subject: [PATCH] Check if the parent is writable to check if a file is deletable --- lib/private/files/storage/common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.39.5