From 505358daaa54d00f18a60efd302b5b54cd8d43ad Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Thu, 24 Oct 2019 11:37:27 +0200 Subject: [PATCH] user: fix get user endpoint for non admin users --- routes/user/user_endpoints.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/user/user_endpoints.go b/routes/user/user_endpoints.go index f88869d..c5087ec 100644 --- a/routes/user/user_endpoints.go +++ b/routes/user/user_endpoints.go @@ -230,7 +230,7 @@ func getUser(c *gin.Context) { reqUserID, _ := c.Get(database.UserIDCtx) reqUserRole, _ := c.Get(database.UserRoleCtx) - if id != reqUserID && reqUserRole != "Admin" { + if uint(id) != reqUserID && reqUserRole != "Admin" { helper.ForbiddenError(c, "Invalid authorization") return }