]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache sharing disabled in the view
authorRobin Appelman <icewind@owncloud.com>
Wed, 30 Dec 2015 13:42:12 +0000 (14:42 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 30 Dec 2015 13:42:22 +0000 (14:42 +0100)
lib/private/files/view.php

index fcea4828c49af093ac5b9fe97de1876cbd56b996..c47dc2f277ef37cb5e8f9f2a121b005c8635ce28 100644 (file)
@@ -1339,11 +1339,12 @@ class View {
                        $folderId = $data['fileid'];
                        $contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter
 
+                       $sharingDisabled = \OCP\Util::isSharingDisabledForUser();
                        /**
                         * @var \OC\Files\FileInfo[] $files
                         */
-                       $files = array_map(function (array $content) use ($path, $storage, $mount) {
-                               if (\OCP\Util::isSharingDisabledForUser()) {
+                       $files = array_map(function (array $content) use ($path, $storage, $mount, $sharingDisabled) {
+                               if ($sharingDisabled) {
                                        $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
                                }
                                $owner = $this->getUserObjectForOwner($storage->getOwner($content['path']));