]> source.dussan.org Git - nextcloud-server.git/commitdiff
check if it is a share storage
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 2 Jun 2014 18:39:20 +0000 (20:39 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 2 Jun 2014 18:39:20 +0000 (20:39 +0200)
apps/files_sharing/lib/permissions.php

index ca694d98adeba36bc5a1e531beadd5d5ef23f7e2..2c4dce36332b5f4fdab8a0e65a46aa87bc7d03f1 100644 (file)
@@ -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));