Fix: can not del root user

pull/39/head
zijiren233 1 year ago
parent 840dc71c34
commit 3eeb8c625f

@ -542,6 +542,11 @@ func DeleteUser(ctx *gin.Context) {
return
}
if u.IsRoot() {
ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorStringResp("cannot delete root"))
return
}
if u.IsAdmin() && !user.IsRoot() {
ctx.AbortWithStatusJSON(http.StatusForbidden, model.NewApiErrorStringResp("cannot delete admin"))
return

Loading…
Cancel
Save