From 125b3736da543064d221ff6848ba2c00993d417c Mon Sep 17 00:00:00 2001 From: sorja Date: Thu, 1 Feb 2024 09:00:29 +0200 Subject: [PATCH] Hide role selection in profile for admin users --- src/client/components/EditUserForm/EditUserForm.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/components/EditUserForm/EditUserForm.tsx b/src/client/components/EditUserForm/EditUserForm.tsx index e6a32b2738..86d1b8eaf4 100644 --- a/src/client/components/EditUserForm/EditUserForm.tsx +++ b/src/client/components/EditUserForm/EditUserForm.tsx @@ -77,7 +77,8 @@ const EditUserForm: React.FC = ({ user, canEditPermissions, canEditRoles, const enabled = canEditUser const isAdmin = Users.isAdministrator(userInfo) - const showRoleSelector = !Areas.isGlobal(countryIso) && isAdmin + const isCurrentUserAdmin = Users.isAdministrator(user) + const showRoleSelector = !Areas.isGlobal(countryIso) && isAdmin && !isCurrentUserAdmin return (