Skip to content

Commit

Permalink
Use LazyUser when creating the user folder
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 7, 2023
1 parent 55db978 commit 6a2f2a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/private/Files/Node/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

namespace OC\Files\Node;

use OC\User\LazyUser;
use OCP\Cache\CappedMemoryCache;
use OC\Files\FileInfo;
use OC\Files\Mount\Manager;
Expand Down Expand Up @@ -362,7 +363,7 @@ public function getName() {
* @throws NotPermittedException
*/
public function getUserFolder($userId) {
$userObject = $this->userManager->get($userId);
$userObject = new LazyUser($userId, $this->userManager);

if (is_null($userObject)) {
$e = new NoUserException('Backends provided no user object');
Expand Down Expand Up @@ -477,7 +478,7 @@ public function getByIdInPath(int $id, string $path): array {
$absolutePath = rtrim($mount->getMountPoint() . $pathRelativeToMount, '/');
return $this->createNode($absolutePath, new FileInfo(
$absolutePath, $mount->getStorage(), $cacheEntry->getPath(), $cacheEntry, $mount,
\OC::$server->getUserManager()->get($mount->getStorage()->getOwner($pathRelativeToMount))
new LazyUser($mount->getStorage()->getOwner($pathRelativeToMount), $this->userManager)
));
}, $mountsContainingFile);

Expand Down

0 comments on commit 6a2f2a1

Please sign in to comment.