mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01:00
fix: User can see the private activity on public activity history. (#818)
This commit is contained in:
parent
ea8c8cdaf3
commit
2db0ffe69e
1 changed files with 5 additions and 5 deletions
|
@ -78,8 +78,9 @@ func Profile(ctx *context.Context) {
|
||||||
ctx.Data["Title"] = ctxUser.DisplayName()
|
ctx.Data["Title"] = ctxUser.DisplayName()
|
||||||
ctx.Data["PageIsUserProfile"] = true
|
ctx.Data["PageIsUserProfile"] = true
|
||||||
ctx.Data["Owner"] = ctxUser
|
ctx.Data["Owner"] = ctxUser
|
||||||
|
showPrivate := ctx.IsSigned && (ctx.User.IsAdmin || ctx.User.ID == ctxUser.ID)
|
||||||
|
|
||||||
orgs, err := models.GetOrgsByUserID(ctxUser.ID, ctx.IsSigned && (ctx.User.IsAdmin || ctx.User.ID == ctxUser.ID))
|
orgs, err := models.GetOrgsByUserID(ctxUser.ID, showPrivate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Handle(500, "GetOrgsByUserIDDesc", err)
|
ctx.Handle(500, "GetOrgsByUserIDDesc", err)
|
||||||
return
|
return
|
||||||
|
@ -91,13 +92,12 @@ func Profile(ctx *context.Context) {
|
||||||
ctx.Data["TabName"] = tab
|
ctx.Data["TabName"] = tab
|
||||||
switch tab {
|
switch tab {
|
||||||
case "activity":
|
case "activity":
|
||||||
retrieveFeeds(ctx, ctxUser, -1, 0, true)
|
retrieveFeeds(ctx, ctxUser, -1, 0, !showPrivate)
|
||||||
if ctx.Written() {
|
if ctx.Written() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case "stars":
|
case "stars":
|
||||||
showPrivateRepos := ctx.IsSigned && ctx.User.ID == ctxUser.ID
|
starredRepos, err := ctxUser.GetStarredRepos(showPrivate)
|
||||||
starredRepos, err := ctxUser.GetStarredRepos(showPrivateRepos)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Handle(500, "GetStarredRepos", err)
|
ctx.Handle(500, "GetStarredRepos", err)
|
||||||
return
|
return
|
||||||
|
@ -109,7 +109,7 @@ func Profile(ctx *context.Context) {
|
||||||
page = 1
|
page = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Data["Repos"], err = models.GetUserRepositories(ctxUser.ID, ctx.IsSigned && ctx.User.ID == ctxUser.ID, page, setting.UI.User.RepoPagingNum)
|
ctx.Data["Repos"], err = models.GetUserRepositories(ctxUser.ID, showPrivate, page, setting.UI.User.RepoPagingNum)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Handle(500, "GetRepositories", err)
|
ctx.Handle(500, "GetRepositories", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue