1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-22 08:42:32 -05:00

Merge pull request #2785 from Rukenshia/develop

Allowing site admins to view private repositories in org/home
This commit is contained in:
Unknwon 2016-03-09 23:20:08 -05:00
commit b44e4d7cb0

View file

@ -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 {