]> source.dussan.org Git - gitea.git/commitdiff
fix #751
authorUnknwon <joe2010xtmf@163.com>
Wed, 17 Dec 2014 01:47:10 +0000 (20:47 -0500)
committerUnknwon <joe2010xtmf@163.com>
Wed, 17 Dec 2014 01:47:10 +0000 (20:47 -0500)
routers/user/home.go

index 83dcb975fe1ccc91ec74f7c730e71268341f19db..f5f6ab9422d17e12c1ae37723cc209bebbe0fa0a 100644 (file)
@@ -198,6 +198,15 @@ func Profile(ctx *middleware.Context) {
                }
                feeds := make([]*models.Action, 0, len(actions))
                for _, act := range actions {
+                       if act.IsPrivate {
+                               if !ctx.IsSigned {
+                                       continue
+                               }
+                               if has, _ := models.HasAccess(ctx.User.Name, act.RepoUserName+"/"+act.RepoName,
+                                       models.READABLE); !has {
+                                       continue
+                               }
+                       }
                        // FIXME: cache results?
                        u, err := models.GetUserByName(act.ActUserName)
                        if err != nil {