aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorAlec S <linuxbash8@gmail.com>2016-03-09 22:56:52 -0600
committerAlec S <linuxbash8@gmail.com>2016-03-09 22:56:52 -0600
commitaf847ef94e02dd120246fa1e8d7f7ab999f0cc90 (patch)
tree82f85bc5c3a7b8fee5b6cdf1f37336c10e73aa24 /routers/user
parentbfed3ea7d3e0ea07fefa90e60514994beae0cb75 (diff)
parentb44e4d7cb08bb88e2f206101a162662ead29836a (diff)
downloadgitea-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.go17
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 {