Skip to content

Commit

Permalink
Always pass is_admin property to userextrainfo
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eszkadev authored and backportbot[bot] committed Jun 5, 2024
1 parent caa80d6 commit 422283a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,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) {
Expand Down

0 comments on commit 422283a

Please sign in to comment.