aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/home.go
diff options
context:
space:
mode:
authorFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 20:12:03 +0000
committerFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 20:12:03 +0000
commitbead46363bbd0f0b8cc42535c231cb2132bc5161 (patch)
tree515cb55abcf5fc9aeba660d771b2f9f172175fbc /routers/user/home.go
parent90780a0d90d19eb7e022603dfd2bf24148818d19 (diff)
downloadgitea-bead46363bbd0f0b8cc42535c231cb2132bc5161.tar.gz
gitea-bead46363bbd0f0b8cc42535c231cb2132bc5161.zip
Evaulate org/team permissions when using the issue/PR view
Diffstat (limited to 'routers/user/home.go')
-rw-r--r--routers/user/home.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index c49b923285..fb3724714d 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -183,11 +183,18 @@ func Issues(ctx *middleware.Context) {
isShowClosed := ctx.Query("state") == "closed"
// Get repositories.
- repos, err := models.GetRepositories(ctxUser.Id, true)
- if err != nil {
- ctx.Handle(500, "GetRepositories", err)
- return
+ if ctxUser.IsOrganization() {
+ if err := ctxUser.GetUserRepositories(ctx.User.Id); err != nil {
+ ctx.Handle(500, "GetRepositories", err)
+ return
+ }
+ } else {
+ if err := ctxUser.GetRepositories(); err != nil {
+ ctx.Handle(500, "GetRepositories", err)
+ return
+ }
}
+ repos := ctxUser.Repos
allCount := 0
repoIDs := make([]int64, 0, len(repos))