fix: don't allow to remove root user

This commit is contained in:
Oleg Lobanov
2021-01-11 22:33:36 +01:00
parent 8cea2f75b3
commit 019ce80fc5
6 changed files with 22 additions and 11 deletions

View File

@@ -40,6 +40,8 @@ func errToStatus(err error) int {
return http.StatusForbidden
case errors.Is(err, libErrors.ErrInvalidRequestParams):
return http.StatusBadRequest
case errors.Is(err, libErrors.ErrRootUserDeletion):
return http.StatusForbidden
default:
return http.StatusInternalServerError
}