diff --git a/modules/middleware/org.go b/modules/middleware/org.go index 29754bb929..37ba4deb1f 100644 --- a/modules/middleware/org.go +++ b/modules/middleware/org.go @@ -48,7 +48,12 @@ func HandleOrgAssignment(ctx *Context, args ...bool) { return } - if ctx.IsSigned { + // Admin has super access. + if ctx.IsSigned && ctx.User.IsAdmin { + ctx.Org.IsOwner = true + ctx.Org.IsMember = true + ctx.Org.IsAdminTeam = true + } else if ctx.IsSigned { ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.Id) if ctx.Org.IsOwner { ctx.Org.IsMember = true @@ -68,6 +73,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) { return } ctx.Data["IsOrganizationOwner"] = ctx.Org.IsOwner + ctx.Data["IsOrganizationMember"] = ctx.Org.IsMember ctx.Org.OrgLink = setting.AppSubUrl + "/org/" + org.Name ctx.Data["OrgLink"] = ctx.Org.OrgLink diff --git a/routers/user/home.go b/routers/user/home.go index df567eaf2c..8b25d799f1 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -316,7 +316,7 @@ func showOrgProfile(ctx *middleware.Context) { org := ctx.Org.Organization ctx.Data["Title"] = org.FullName - repos, err := models.GetRepositories(org.Id, ctx.IsSigned && org.IsOrgMember(ctx.User.Id)) + repos, err := models.GetRepositories(org.Id, ctx.IsSigned && (ctx.User.IsAdmin || org.IsOrgMember(ctx.User.Id))) if err != nil { ctx.Handle(500, "GetRepositories", err) return diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index f1e19e30dc..fdd494b19b 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -24,7 +24,6 @@