From a042be91193b78d1f218e2d72b249bd1a3ab32b9 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Thu, 6 Oct 2022 22:25:49 +0200 Subject: [PATCH] do not show remove user or ban user if user is owner or moderator --- MareSynchronos/UI/GroupPanel.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MareSynchronos/UI/GroupPanel.cs b/MareSynchronos/UI/GroupPanel.cs index 888c8d7..2c8565d 100644 --- a/MareSynchronos/UI/GroupPanel.cs +++ b/MareSynchronos/UI/GroupPanel.cs @@ -608,18 +608,18 @@ namespace MareSynchronos.UI _ = _apiController.SendChangeUserPinned(entry.GroupGID, entry.UserUID, !entry.IsPinned ?? false); } UiShared.AttachToolTip("Pin this user to the Syncshell. Pinned users will not be deleted in case of a manually initiated Syncshell clean"); - if (UiShared.IconTextButton(FontAwesomeIcon.Trash, "Remove user")) - { - if (UiShared.CtrlPressed()) - { - _ = _apiController.SendRemoveUserFromGroup(entry.GroupGID, entry.UserUID); - } - } var userIsMod = string.Equals(entry.UserUID, ownerUid, StringComparison.Ordinal); var userIsOwner = string.Equals(entry.UserAlias, ownerUid, StringComparison.Ordinal); if ((!entry.IsModerator ?? false) && !(userIsMod || userIsOwner)) { + if (UiShared.IconTextButton(FontAwesomeIcon.Trash, "Remove user")) + { + if (UiShared.CtrlPressed()) + { + _ = _apiController.SendRemoveUserFromGroup(entry.GroupGID, entry.UserUID); + } + } UiShared.AttachToolTip("Hold CTRL and click to remove user " + (entry.UserAlias ?? entry.UserUID) + " from Syncshell"); if (UiShared.IconTextButton(FontAwesomeIcon.UserSlash, "Ban User"))