Disallow deleting of admin user from the UI (#2487)

pull/2507/head
Glenn Wilkinson 2022-06-01 17:01:55 +01:00
parent 0c255bbe92
commit d0ff3829e5
2 changed files with 9 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -89,6 +89,14 @@ const deleteUser = (id) => {
if (!user) { if (!user) {
return return
} }
if (user.username == "admin") {
Swal.fire({
title: "Unable to Delete User",
text: "The user account " + escapeHtml(user.username) + " cannot be deleted.",
type: "info"
});
return
}
Swal.fire({ Swal.fire({
title: "Are you sure?", title: "Are you sure?",
text: "This will delete the account for " + escapeHtml(user.username) + " as well as all of the objects they have created.\n\nThis can't be undone!", text: "This will delete the account for " + escapeHtml(user.username) + " as well as all of the objects they have created.\n\nThis can't be undone!",