summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 10:46:04 +0000
committerFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 15:29:45 +0000
commit5eafe2b17eb9a1cf1068e7a3ed7a57a2730f04b0 (patch)
treeecff925eb264af9e410f0580ab28d7b9948a4471 /routers/user
parent8436d69eaf435ae6bb50f648c1aed3eef7b0850b (diff)
downloadgitea-5eafe2b17eb9a1cf1068e7a3ed7a57a2730f04b0.tar.gz
gitea-5eafe2b17eb9a1cf1068e7a3ed7a57a2730f04b0.zip
Only show repositories the user has access to, on the organization home
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index b5df5e3679..b198e801d2 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -314,20 +314,19 @@ func showOrgProfile(ctx *middleware.Context) {
org := ctx.Org.Organization
ctx.Data["Title"] = org.FullName
- repos, err := models.GetRepositories(org.Id, ctx.IsSigned && (ctx.User.IsAdmin || org.IsOrgMember(ctx.User.Id)))
- if err != nil {
- ctx.Handle(500, "GetRepositories", err)
+ if err := org.GetUserRepositories(ctx.User.Id); err != nil {
+ ctx.Handle(500, "GetUserRepositories", err)
return
}
- ctx.Data["Repos"] = repos
+ ctx.Data["Repos"] = org.Repos
- if err = org.GetMembers(); err != nil {
+ if err := org.GetMembers(); err != nil {
ctx.Handle(500, "GetMembers", err)
return
}
ctx.Data["Members"] = org.Members
- if err = org.GetTeams(); err != nil {
+ if err := org.GetTeams(); err != nil {
ctx.Handle(500, "GetTeams", err)
return
}