summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-02-18 08:59:22 +0200
committerPeter Smit <peter@smitmail.eu>2015-02-18 08:59:22 +0200
commit0fa209d07b6155943bfd235257a4ed6a484a9a85 (patch)
tree32f8396c0576d64e9d67fecce6570b86adfc7866 /routers/user
parent455fad0fbd85137af5d3efec93d2b974e9383b98 (diff)
downloadgitea-0fa209d07b6155943bfd235257a4ed6a484a9a85.tar.gz
gitea-0fa209d07b6155943bfd235257a4ed6a484a9a85.zip
Update/simplify fix that owners also see actions on their repositories
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 574c6387dc..0a1d9dd217 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -103,14 +103,14 @@ func Dashboard(ctx *middleware.Context) {
feeds := make([]*models.Action, 0, len(actions))
for _, act := range actions {
if act.IsPrivate {
- repo := &models.Repository{Id: act.RepoId, IsPrivate: true}
// This prevents having to retrieve the repository for each action
- if act.RepoUserName == ctx.User.LowerName {
- repo.OwnerId = ctx.User.Id
- }
- if has, _ := models.HasAccess(ctx.User, repo, models.ACCESS_MODE_READ); !has {
- continue
+ repo := &models.Repository{Id: act.RepoId, IsPrivate: true}
+ if act.RepoUserName != ctx.User.LowerName {
+ if has, _ := models.HasAccess(ctx.User, repo, models.ACCESS_MODE_READ); !has {
+ continue
+ }
}
+
}
// FIXME: cache results?
u, err := models.GetUserByName(act.ActUserName)
@@ -215,14 +215,14 @@ func Profile(ctx *middleware.Context) {
if !ctx.IsSigned {
continue
}
- repo := &models.Repository{Id: act.RepoId, IsPrivate: true}
// This prevents having to retrieve the repository for each action
- if act.RepoUserName == ctx.User.LowerName {
- repo.OwnerId = ctx.User.Id
- }
- if has, _ := models.HasAccess(ctx.User, repo, models.ACCESS_MODE_READ); !has {
- continue
+ repo := &models.Repository{Id: act.RepoId, IsPrivate: true}
+ if act.RepoUserName != ctx.User.LowerName {
+ if has, _ := models.HasAccess(ctx.User, repo, models.ACCESS_MODE_READ); !has {
+ continue
+ }
}
+
}
// FIXME: cache results?
u, err := models.GetUserByName(act.ActUserName)