mirror of https://github.com/mindoc-org/mindoc.git
禁止变更超级管理员的权限和状态
parent
89b59ab1e1
commit
a562499b83
|
@ -152,6 +152,9 @@ func (c *ManagerController) UpdateMemberStatus() {
|
|||
if member.MemberId == c.Member.MemberId {
|
||||
c.JsonResult(6004,"不能变更自己的状态")
|
||||
}
|
||||
if member.Role == conf.MemberSuperRole {
|
||||
c.JsonResult(6005,"不能变更超级管理员的状态")
|
||||
}
|
||||
member.Status = status
|
||||
|
||||
if err := member.Update(); err != nil {
|
||||
|
@ -185,6 +188,9 @@ func (c *ManagerController) ChangeMemberRole() {
|
|||
if member.MemberId == c.Member.MemberId {
|
||||
c.JsonResult(6004,"不能变更自己的权限")
|
||||
}
|
||||
if member.Role == conf.MemberSuperRole {
|
||||
c.JsonResult(6005,"不能变更超级管理员的权限")
|
||||
}
|
||||
member.Role = role
|
||||
|
||||
if err := member.Update(); err != nil {
|
||||
|
|
Loading…
Reference in New Issue