浏览代码

fix: allow super admin to change its permissions

JustSong 2 年之前
父节点
当前提交
ea192d9e3f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      controller/user.go

+ 1 - 1
controller/user.go

@@ -584,7 +584,7 @@ func ManageUser(c *gin.Context) {
 		return
 		return
 	}
 	}
 	myRole := c.GetInt("role")
 	myRole := c.GetInt("role")
-	if myRole <= user.Role {
+	if myRole <= user.Role && myRole != common.RoleRootUser {
 		c.JSON(http.StatusOK, gin.H{
 		c.JSON(http.StatusOK, gin.H{
 			"success": false,
 			"success": false,
 			"message": "无权更新同权限等级或更高权限等级的用户信息",
 			"message": "无权更新同权限等级或更高权限等级的用户信息",