diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-09 13:36:33 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-09 13:36:33 +0200 |
commit | 0d158e569b0c19614b5e946849e8b7a8e4a75015 (patch) | |
tree | 7702d6fbf2d26b789520f7ef9db11946797e1942 /routers/repo/http.go | |
parent | 4e79adf6b5bf7ec7bc3b2b47469baafd1cb0b774 (diff) | |
download | gitea-0d158e569b0c19614b5e946849e8b7a8e4a75015.tar.gz gitea-0d158e569b0c19614b5e946849e8b7a8e4a75015.zip |
Change constants to UPPERCASE_WITH_UNDERSCORE style
Diffstat (limited to 'routers/repo/http.go')
-rw-r--r-- | routers/repo/http.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go index 716c71272a..4173c7a91f 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -115,9 +115,9 @@ func Http(ctx *middleware.Context) { } if !isPublicPull { - var tp = models.WriteAccess + var tp = models.ACCESS_MODE_WRITE if isPull { - tp = models.ReadAccess + tp = models.ACCESS_MODE_READ } has, err := models.HasAccess(authUser, repo, tp) @@ -125,8 +125,8 @@ func Http(ctx *middleware.Context) { ctx.Handle(401, "no basic auth and digit auth", nil) return } else if !has { - if tp == models.ReadAccess { - has, err = models.HasAccess(authUser, repo, models.WriteAccess) + if tp == models.ACCESS_MODE_READ { + has, err = models.HasAccess(authUser, repo, models.ACCESS_MODE_WRITE) if err != nil || !has { ctx.Handle(401, "no basic auth and digit auth", nil) return @@ -268,7 +268,7 @@ func serviceRpc(rpc string, hr handler) { access := hasAccess(r, hr.Config, dir, rpc, true) if access == false { - renderNoAccess(w) + renderACCESS_MODE_NONE(w) return } @@ -495,7 +495,7 @@ func renderNotFound(w http.ResponseWriter) { w.Write([]byte("Not Found")) } -func renderNoAccess(w http.ResponseWriter) { +func renderACCESS_MODE_NONE(w http.ResponseWriter) { w.WriteHeader(http.StatusForbidden) w.Write([]byte("Forbidden")) } |