aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/http.go
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-02-05 15:29:08 +0200
committerPeter Smit <peter@smitmail.eu>2015-02-12 14:14:45 +0200
commit0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608 (patch)
tree7068350836e187523f0bcf741695c84c0eab42a9 /routers/repo/http.go
parent2804784df93f392ed76a85d8e7153c66964f1ba5 (diff)
downloadgitea-0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608.tar.gz
gitea-0a4cda0dd4d7c906668d9d2e283fbe9ebe2e1608.zip
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/repo/http.go')
-rw-r--r--routers/repo/http.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index f5dc0c9d6a..c6742af3ec 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -137,18 +137,18 @@ func Http(ctx *middleware.Context) {
}
if !isPublicPull {
- var tp = models.WRITABLE
+ var tp = models.WriteAccess
if isPull {
- tp = models.READABLE
+ tp = models.ReadAccess
}
- has, err := models.HasAccess(authUsername, username+"/"+reponame, tp)
+ has, err := models.HasAccess(authUser, repo, tp)
if err != nil {
ctx.Handle(401, "no basic auth and digit auth", nil)
return
} else if !has {
- if tp == models.READABLE {
- has, err = models.HasAccess(authUsername, username+"/"+reponame, models.WRITABLE)
+ if tp == models.ReadAccess {
+ has, err = models.HasAccess(authUser, repo, models.WriteAccess)
if err != nil || !has {
ctx.Handle(401, "no basic auth and digit auth", nil)
return