mirror of https://github.com/go-gitea/gitea.git
Merge pull request #2785 from Rukenshia/develop
Allowing site admins to view private repositories in org/home
This commit is contained in:
commit
b44e4d7cb0
|
@ -332,11 +332,20 @@ func showOrgProfile(ctx *middleware.Context) {
|
||||||
ctx.Data["Title"] = org.FullName
|
ctx.Data["Title"] = org.FullName
|
||||||
|
|
||||||
if ctx.IsSigned {
|
if ctx.IsSigned {
|
||||||
if err := org.GetUserRepositories(ctx.User.Id); err != nil {
|
if ctx.User.IsAdmin {
|
||||||
ctx.Handle(500, "GetUserRepositories", err)
|
repos, err := models.GetRepositories(org.Id, true)
|
||||||
return
|
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 {
|
} else {
|
||||||
repos, err := models.GetRepositories(org.Id, false)
|
repos, err := models.GetRepositories(org.Id, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue