Skip to content

Commit

Permalink
HRMNY-16195 avoid disabling all admins
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergonzalez committed Jan 22, 2025
1 parent 46422eb commit 1aa5fcc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/apps/admin-ui/src/user/EditUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default function EditUser() {
isServiceUser: serviceUsers.some(
(serviceUser) => serviceUser.id === user.id
),
isDefaultUser: user.username?.toLowerCase() === "default",
};
},
({ user, bruteForced, isServiceUser }) => {
Expand Down Expand Up @@ -225,7 +226,11 @@ const EditUserForm = ({
</DropdownItem>,
]),
]}
onToggle={(value) => save({ ...user, enabled: value })}
onToggle={(value) => {
if (user.username?.toLowerCase() != "default") {
save({ ...user, enabled: value });
}
}}
isEnabled={user.enabled}
/>
)}
Expand Down

0 comments on commit 1aa5fcc

Please sign in to comment.