diff --git a/api/errors.go b/api/errors.go index 709bafb92..854cefbab 100644 --- a/api/errors.go +++ b/api/errors.go @@ -15,7 +15,6 @@ const ( ErrUserAlreadyExists = Error("User already exists") ErrInvalidUsername = Error("Invalid username. White spaces are not allowed") ErrAdminAlreadyInitialized = Error("An administrator user already exists") - ErrCannotRemoveAdmin = Error("Cannot remove the default administrator account") ErrAdminCannotRemoveSelf = Error("Cannot remove your own user account. Contact another administrator") ) diff --git a/api/http/handler/user.go b/api/http/handler/user.go index 72952737d..d4f34d9b4 100644 --- a/api/http/handler/user.go +++ b/api/http/handler/user.go @@ -397,11 +397,6 @@ func (handler *UserHandler) handleDeleteUser(w http.ResponseWriter, r *http.Requ return } - if userID == 1 { - httperror.WriteErrorResponse(w, portainer.ErrCannotRemoveAdmin, http.StatusForbidden, handler.Logger) - return - } - tokenData, err := security.RetrieveTokenData(r) if err != nil { httperror.WriteErrorResponse(w, err, http.StatusInternalServerError, handler.Logger)