Fix panic when view profile without signin

Also fix that no matter who, still able to see organizations with private membership.
This commit is contained in:
Unknwon 2016-02-19 18:10:03 -05:00
parent f38d5e57dd
commit aa12135b97
2 changed files with 10 additions and 12 deletions

View file

@ -75,7 +75,7 @@ func Profile(ctx *middleware.Context) {
ctx.Data["PageIsUserProfile"] = true
ctx.Data["Owner"] = u
orgs, err := models.GetOrgsByUserIDDesc(u.Id, "updated", ctx.User.IsAdmin || ctx.User.Id == u.Id)
orgs, err := models.GetOrgsByUserID(u.Id, ctx.IsSigned && (ctx.User.IsAdmin || ctx.User.Id == u.Id))
if err != nil {
ctx.Handle(500, "GetOrgsByUserIDDesc", err)
return