From 7b9a75bedbe5ff48b343648cbb26ae2313406052 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Thu, 16 Jan 2025 11:18:07 +0100 Subject: [PATCH] fix: Prefer mount owner over current user as owner of the storage Signed-off-by: Julius Knorr --- lib/Mount/GroupFolderStorage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Mount/GroupFolderStorage.php b/lib/Mount/GroupFolderStorage.php index 94daba55e..b18ca8bac 100644 --- a/lib/Mount/GroupFolderStorage.php +++ b/lib/Mount/GroupFolderStorage.php @@ -39,11 +39,16 @@ public function getFolderId(): int { * @psalm-suppress FalsableReturnStatement Return type of getOwner is not clear even in server */ public function getOwner($path) { + if ($this->mountOwner !== null) { + return $this->mountOwner->getUID(); + } + $user = $this->userSession->getUser(); if ($user !== null) { return $user->getUID(); } - return $this->mountOwner !== null ? $this->mountOwner->getUID() : false; + + return false; } public function getCache($path = '', $storage = null) {