Merge pull request #21398 from owncloud/sharing-disabled-cache

Cache isSharingDisabledForUser
This commit is contained in:
Thomas Müller 2016-01-06 17:23:14 +01:00
commit 002161857c
1 changed files with 3 additions and 2 deletions

View File

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