diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-05 15:29:08 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-12 14:14:45 +0200 |
commit | 0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608 (patch) | |
tree | 7068350836e187523f0bcf741695c84c0eab42a9 /routers/user | |
parent | 2804784df93f392ed76a85d8e7153c66964f1ba5 (diff) |
Refactoring of the Access Table
This commit does a lot of the work of refactoring the access table in a table with id's instead of strings.
The result does compile, but has not been tested. It may eat your kittens.
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/home.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/user/home.go b/routers/user/home.go index 5b02154c..82325cb7 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -103,8 +103,7 @@ func Dashboard(ctx *middleware.Context) { feeds := make([]*models.Action, 0, len(actions)) for _, act := range actions { if act.IsPrivate { - if has, _ := models.HasAccess(ctx.User.Name, act.RepoUserName+"/"+act.RepoName, - models.READABLE); !has { + if has, _ := models.HasAccess(ctx.User, &models.Repository{Id: act.RepoId, IsPrivate: true}, models.ReadAccess); !has { continue } } @@ -211,8 +210,8 @@ func Profile(ctx *middleware.Context) { if !ctx.IsSigned { continue } - if has, _ := models.HasAccess(ctx.User.Name, act.RepoUserName+"/"+act.RepoName, - models.READABLE); !has { + if has, _ := models.HasAccess(ctx.User, &models.Repository{Id: act.RepoId, IsPrivate: true}, + models.ReadAccess); !has { continue } } |