diff options
Diffstat (limited to 'routers/api/v1')
-rw-r--r-- | routers/api/v1/repo/repo.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 2c01352fcf..c299b969bc 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -32,7 +32,9 @@ func Search(ctx *context.APIContext) { Keyword: strings.Trim(ctx.Query("q"), " "), OwnerID: ctx.QueryInt64("uid"), PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")), - Searcher: ctx.User, + } + if ctx.User.ID == opts.OwnerID { + opts.Searcher = ctx.User } // Check visibility. |