From d7931b82ae2d17ab8ea5ae5d43f23ea622c13bc6 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 3 Sep 2018 22:56:28 +0200 Subject: [PATCH] Check the permission of the underlying storage Else shares might expose more permissions than the storage actually providers. Signed-off-by: Roeland Jago Douma --- apps/files_sharing/lib/SharedStorage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 2d2f14fc554..77019e25265 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -195,7 +195,8 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto if (!$this->isValid()) { return 0; } - $permissions = $this->superShare->getPermissions(); + $permissions = parent::getPermissions($target) & $this->superShare->getPermissions(); + // part files and the mount point always have delete permissions if ($target === '' || pathinfo($target, PATHINFO_EXTENSION) === 'part') { $permissions |= \OCP\Constants::PERMISSION_DELETE;