Skip to content

Commit f24d3bc

Browse files
Append simple visibility check to user GetInfo api
1 parent fd4f147 commit f24d3bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routers/api/v1/user/user.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ func GetInfo(ctx *context.APIContext) {
103103
// "$ref": "#/responses/notFound"
104104

105105
u := GetUserByParams(ctx)
106+
if !u.IsVisibleToUser(ctx.User) {
107+
ctx.JSON(http.StatusNotFound, nil)
108+
return
109+
}
106110
if ctx.Written() {
107111
return
108112
}

0 commit comments

Comments
 (0)