Admins and user itself sees private org relations on profile
This commit is contained in:
parent
894946c319
commit
2cfe6f8c60
3 changed files with 17 additions and 9 deletions
|
@ -75,11 +75,12 @@ func Profile(ctx *middleware.Context) {
|
|||
ctx.Data["PageIsUserProfile"] = true
|
||||
ctx.Data["Owner"] = u
|
||||
|
||||
orgs, err := models.GetPublicOrgsByUserIDDesc(u.Id, "updated")
|
||||
orgs, err := models.GetOrgsByUserIDDesc(u.Id, "updated", ctx.User.IsAdmin || ctx.User.Id == u.Id)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetPublicOrgsByUserIDDesc", err)
|
||||
ctx.Handle(500, "GetOrgsByUserIDDesc", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["Orgs"] = orgs
|
||||
|
||||
tab := ctx.Query("tab")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue