mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 19:14:06 +01:00
Allowing site admins to view private repositories in org/home
This commit is contained in:
parent
0c9a616326
commit
72a8fa3bc8
1 changed files with 13 additions and 4 deletions
|
@ -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 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 {
|
if err := org.GetUserRepositories(ctx.User.Id); err != nil {
|
||||||
ctx.Handle(500, "GetUserRepositories", err)
|
ctx.Handle(500, "GetUserRepositories", err)
|
||||||
return
|
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 a new issue