Merge pull request #2578 from exmex/develop

Admins and user itself sees private org relations on profile
This commit is contained in:
Unknwon 2016-02-14 20:34:53 -05:00
commit d8631b616e
2 changed files with 12 additions and 8 deletions

View file

@ -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")