From 916f85937785f6580f201cdf95fb42f63457af94 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 2 Jun 2014 20:39:20 +0200 Subject: [PATCH] check if it is a share storage --- apps/files_sharing/lib/permissions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php index ca694d98ade..2c4dce36332 100644 --- a/apps/files_sharing/lib/permissions.php +++ b/apps/files_sharing/lib/permissions.php @@ -79,7 +79,11 @@ class Shared_Permissions extends Permissions { */ public function getDirectoryPermissions($parentId, $user) { - $fileCacheId = ($parentId === -1) ? $this->storage->getSourceId() : $parentId; + if ($parentId === -1 && $this->storage->instanceOfStorage('\OC\Files\Storage\Shared')) { + $fileCacheId = $this->storage->getSourceId(); + } else { + $fileCacheId = $parentId; + } $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `parent` = ?'); $result = $query->execute(array($fileCacheId)); -- 2.39.5