From 7c8bbc1a524bbc314fcc9232d8bddf14147d9467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Mon, 10 Jun 2024 21:27:53 +0200 Subject: [PATCH] Use new property for admin user indication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit is_admin field inside UserExtraInfo is deprecated now. We use dedicated IsAdminUser property in CheckFileInfo instead. Leave old code for now for backward compatibility. see: https://github.com/CollaboraOnline/online/pull/9242 Signed-off-by: Szymon Kłos --- lib/Controller/WopiController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index 1a768f938b..f622aeb2d2 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -272,13 +272,16 @@ public function checkFileInfo($fileId, $access_token) { if ($user !== null) { $response['UserExtraInfo']['avatar'] = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $wopi->getEditorUid(), 'size' => self::WOPI_AVATAR_SIZE]); if ($this->groupManager->isAdmin($wopi->getEditorUid())) { - $response['UserExtraInfo']['is_admin'] = true; + $response['UserExtraInfo']['is_admin'] = true; // DEPRECATED + $response['IsAdminUser'] = true; } else { - $response['UserExtraInfo']['is_admin'] = false; + $response['UserExtraInfo']['is_admin'] = false; // DEPRECATED + $response['IsAdminUser'] = false; } } else { $response['UserExtraInfo']['avatar'] = $this->urlGenerator->linkToRouteAbsolute('core.GuestAvatar.getAvatar', ['guestName' => urlencode($wopi->getGuestDisplayname()), 'size' => self::WOPI_AVATAR_SIZE]); - $response['UserExtraInfo']['is_admin'] = false; + $response['UserExtraInfo']['is_admin'] = false; // DEPRECATED + $response['IsAdminUser'] = false; } if ($isPublic) {