aboutsummaryrefslogtreecommitdiff
path: root/routers
diff options
context:
space:
mode:
authorRob Richards <goodeveningthisisrobrichards@gmail.com>2017-03-12 23:37:12 -0500
committer无闻 <u@gogs.io>2017-03-13 00:37:12 -0400
commitaaadc61ee81a32ffb1497ed609f4f65899bce61d (patch)
tree0b3d847f4a527d6e2f3d34eeb1a7a6a959c998f3 /routers
parent44a6b6331630d301a4c97719b108846e5d6173cf (diff)
models/repo: allow SearchRepos to return private but accessible repositories (#4273)
* models/repo.go SearchRepositoryByName() Updated function to return public and private repositories that the logged in user has been given rights to view issue #3088 * models/repo.go SearchRepositoryName changed repository table alias to 'repo' removed debug line * models/repo.go SearchRepositoryByName modified UserID search query to use the "access" table instead of team_repo, team_user etc * models/repo.go SearchRepositoryByName 1) uppercased SQL keywords 2) removed alias for ACCESS table
Diffstat (limited to 'routers')
-rw-r--r--routers/home.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/home.go b/routers/home.go
index 22a131a6..63a56490 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -77,6 +77,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
} else {
repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
Keyword: keyword,
+ UserID: ctx.User.ID,
OrderBy: opts.OrderBy,
Private: opts.Private,
Page: page,