fix(users): visitor user can not be deleted
This commit is contained in:
parent
563e90b3a4
commit
963f5b199a
1 changed files with 2 additions and 2 deletions
|
@ -460,8 +460,8 @@ func (h *MultiUsersSvc) DelUser(c *gin.Context) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(q.ErrResp(c, 400, fmt.Errorf("invalid users ID %w", err)))
|
c.JSON(q.ErrResp(c, 400, fmt.Errorf("invalid users ID %w", err)))
|
||||||
return
|
return
|
||||||
} else if userID == 0 {
|
} else if userID == 0 || userID == 1 { // 0=root, 1=visitor
|
||||||
c.JSON(q.ErrResp(c, 400, errors.New("It is not allowed to delete root")))
|
c.JSON(q.ErrResp(c, 400, errors.New("It is not allowed to delete predefined users")))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue