禁止变更超级管理员的权限和状态

pull/51/head
Minho 2017-05-25 18:20:49 +08:00
parent 89b59ab1e1
commit a562499b83
1 changed files with 6 additions and 0 deletions

View File

@ -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 {