From bba1847a8eb08dfc5a3302a23ee210b21e0e71d3 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Sun, 31 Jan 2016 18:13:39 +0000 Subject: Everyone can see public repos --- routers/user/home.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'routers/user/home.go') diff --git a/routers/user/home.go b/routers/user/home.go index fabe7b1f31..6e2135dca2 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -312,14 +312,22 @@ func showOrgProfile(ctx *middleware.Context) { } org := ctx.Org.Organization - userId := ctx.User.Id ctx.Data["Title"] = org.FullName - if err := org.GetUserRepositories(userId); err != nil { - ctx.Handle(500, "GetUserRepositories", err) - return + if ctx.IsSigned { + if err := org.GetUserRepositories(ctx.User.Id); err != nil { + ctx.Handle(500, "GetUserRepositories", err) + return + } + ctx.Data["Repos"] = org.Repos + } else { + if repos, err := models.GetRepositories(org.Id, false); err != nil { + ctx.Handle(500, "GetRepositories", err) + return + } else { + ctx.Data["Repos"] = repos + } } - ctx.Data["Repos"] = org.Repos if err := org.GetMembers(); err != nil { ctx.Handle(500, "GetMembers", err) -- cgit v1.2.3