Skip to content

Commit

Permalink
fixup! fixup! Add a method to get all users with access to a file in OCP
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Jun 26, 2023
1 parent a0e7e0a commit e2616c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/private/Files/Config/UserMountCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use OCP\IDBConnection;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Server;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit e2616c3

Please sign in to comment.