diff --git a/routers/api/v1/tech/tech.go b/routers/api/v1/tech/tech.go index 37a795c21..e62b0dd19 100644 --- a/routers/api/v1/tech/tech.go +++ b/routers/api/v1/tech/tech.go @@ -254,13 +254,7 @@ func FindTech(ctx *context.APIContext) { } func IsAdmin(ctx *context.APIContext) { - userName := ctx.Query("user") - user, err := models.GetUserByName(userName) - if err != nil { - ctx.JSON(http.StatusOK, response.OuterServerError("User not exists")) - return - } - isAdmin := role.UserHasRole(user.ID, models.TechProgramAdmin) + isAdmin := role.UserHasRole(ctx.User.ID, models.TechProgramAdmin) r := map[string]interface{}{} r["is_admin"] = isAdmin ctx.JSON(http.StatusOK, response.OuterSuccessWithData(r))