Explorar o código

fix: allow super admin to change its permissions

JustSong %!s(int64=2) %!d(string=hai) anos
pai
achega
ea192d9e3f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      controller/user.go

+ 1 - 1
controller/user.go

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