From e2616c313374f38f42edf1fc6164fe7d9fa5f778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 26 Jun 2023 15:53:34 +0200 Subject: [PATCH] fixup! fixup! Add a method to get all users with access to a file in OCP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Files/Config/UserMountCache.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 590cd6a3fa141..31a95ee2a460a 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -42,6 +42,7 @@ use OCP\IDBConnection; use OCP\IUser; use OCP\IUserManager; +use OCP\Server; use Psr\Log\LoggerInterface; /** @@ -392,7 +393,7 @@ public function getMountsForFileId($fileId, $user = null) { * @since 28.0.0 */ public function getNodesByUserForFileId(int $fileId): array { - $mounts = $this->getMountsForFileId($id); + $mounts = $this->getMountsForFileId($fileId); $rootFolder = Server::get(IRootFolder::class); $result = []; foreach ($mounts as $mount) { @@ -401,7 +402,7 @@ public function getNodesByUserForFileId(int $fileId): array { } $userFolder = $rootFolder->getUserFolder($mount->getUser()->getUID()); - $result[$mount->getUser()->getUID()] = $userFolder->getById($id); + $result[$mount->getUser()->getUID()] = $userFolder->getById($fileId); } return $result;