From 9bed856cc84c5b8a7e798e2680c409ef77847cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Mon, 3 Jun 2024 18:55:25 +0200 Subject: [PATCH] Always pass is_admin property to userextrainfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will be used by COOL for server audit dialog - which should be shown only for admin users. In case of missing is_admin property - it will be shown too because it means integration don't use that property. Signed-off-by: Szymon Kłos --- lib/Controller/WopiController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index 2c49c87f2b..32a36827c8 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -198,9 +198,12 @@ public function checkFileInfo($fileId, $access_token) { $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; + } else { + $response['UserExtraInfo']['is_admin'] = 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; } if ($isPublic) {