aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index fcea4828c49..357f854e5e2 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -86,6 +86,8 @@ class View {
private $updaterEnabled = true;
+ private $userManager;
+
/**
* @param string $root
* @throws \Exception If $root contains an invalid path
@@ -101,6 +103,7 @@ class View {
$this->fakeRoot = $root;
$this->lockingProvider = \OC::$server->getLockingProvider();
$this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider);
+ $this->userManager = \OC::$server->getUserManager();
}
public function getAbsolutePath($path = '/') {
@@ -1196,7 +1199,7 @@ class View {
* @return \OC\User\User
*/
private function getUserObjectForOwner($ownerId) {
- $owner = \OC::$server->getUserManager()->get($ownerId);
+ $owner = $this->userManager->get($ownerId);
if ($owner instanceof IUser) {
return $owner;
} else {
@@ -1339,11 +1342,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']));