Commit 6c58e566 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/manage-user' into develop

parents d8bccdd5 eeb92e15
......@@ -133,6 +133,7 @@ var (
ErrDeleteUser = &Errno{Code: 20105, Message: "The user delete error."}
ErrExistUser = &Errno{Code: 20106, Message: "The user already exists."}
ErrDeleteSelf = &Errno{Code: 20105, Message: "The user can not delete yourself."}
ErrUpdateSelf = &Errno{Code: 20105, Message: "The user can not modify yourself."}
ErrPasswordIncorrect = &Errno{Code: 20107, Message: "The password was incorrect."}
ErrUserAuthIncorrect = &Errno{Code: 40001, Message: "The user auth was incorrect."}
ErrUserTokenIncorrect = &Errno{Code: 40001, Message: "The user token was incorrect."}
......
......@@ -151,6 +151,10 @@ func EditManager(c *gin.Context) {
var platform_id int32
platform_id = int32(user.UserInfo.PlatformId)
if user.UserInfo.Group == manager.Group {
handler.SendResponse(c, errno.ErrUserAuthIncorrect, nil)
return
}
if "admin" == group && platform_id != manager.PlatformId {
handler.SendResponse(c, errno.ErrUserAuthIncorrect, nil)
......@@ -165,7 +169,7 @@ func EditManager(c *gin.Context) {
manager_service.Status = manager_params.Status
err = manager_service.Edit()
if err != nil {
handler.SendResponse(c, errno.ErrDeleteUser, nil)
handler.SendResponse(c, errno.ErrUpdateSelf, nil)
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment