diff options
author | Alec S <linuxbash8@gmail.com> | 2016-03-09 22:56:52 -0600 |
---|---|---|
committer | Alec S <linuxbash8@gmail.com> | 2016-03-09 22:56:52 -0600 |
commit | af847ef94e02dd120246fa1e8d7f7ab999f0cc90 (patch) | |
tree | 82f85bc5c3a7b8fee5b6cdf1f37336c10e73aa24 /routers/user | |
parent | bfed3ea7d3e0ea07fefa90e60514994beae0cb75 (diff) | |
parent | b44e4d7cb08bb88e2f206101a162662ead29836a (diff) | |
download | gitea-af847ef94e02dd120246fa1e8d7f7ab999f0cc90.tar.gz gitea-af847ef94e02dd120246fa1e8d7f7ab999f0cc90.zip |
Merge branch 'develop' of github.com:gogits/gogs into develop
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/home.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/routers/user/home.go b/routers/user/home.go index 3b83529d05..ffebe28489 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -332,11 +332,20 @@ func showOrgProfile(ctx *middleware.Context) { ctx.Data["Title"] = org.FullName if ctx.IsSigned { - if err := org.GetUserRepositories(ctx.User.Id); err != nil { - ctx.Handle(500, "GetUserRepositories", err) - return + if ctx.User.IsAdmin { + repos, err := models.GetRepositories(org.Id, true) + if err != nil { + ctx.Handle(500, "GetRepositoriesAsAdmin", err) + return + } + ctx.Data["Repos"] = repos + } else { + if err := org.GetUserRepositories(ctx.User.Id); err != nil { + ctx.Handle(500, "GetUserRepositories", err) + return + } + ctx.Data["Repos"] = org.Repos } - ctx.Data["Repos"] = org.Repos } else { repos, err := models.GetRepositories(org.Id, false) if err != nil { |