diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-02-13 00:58:46 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-02-13 00:58:46 -0500 |
commit | 6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68 (patch) | |
tree | 02b1617a75095fe5f072533708e920fbac477d34 /routers | |
parent | b99c4baab22ec080906582703809e5ec12bae3f9 (diff) | |
download | gitea-6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68.tar.gz gitea-6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68.zip |
code fix #941 caution: undertest
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/http.go | 4 | ||||
-rw-r--r-- | routers/user/home.go | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go index a209c2b254..034b5a7b5e 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -288,7 +288,7 @@ func serviceRpc(rpc string, hr handler) { access := hasAccess(r, hr.Config, dir, rpc, true) if access == false { - renderACCESS_MODE_NONE(w) + renderNoAccess(w) return } @@ -515,7 +515,7 @@ func renderNotFound(w http.ResponseWriter) { w.Write([]byte("Not Found")) } -func renderACCESS_MODE_NONE(w http.ResponseWriter) { +func renderNoAccess(w http.ResponseWriter) { w.WriteHeader(http.StatusForbidden) w.Write([]byte("Forbidden")) } diff --git a/routers/user/home.go b/routers/user/home.go index ce82ae772c..35407534f9 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -210,8 +210,11 @@ func Profile(ctx *middleware.Context) { if !ctx.IsSigned { continue } - if has, _ := models.HasAccess(ctx.User, &models.Repository{Id: act.RepoId, IsPrivate: true}, - models.ACCESS_MODE_READ); !has { + if has, _ := models.HasAccess(ctx.User, + &models.Repository{ + Id: act.RepoId, + IsPrivate: true, + }, models.ACCESS_MODE_READ); !has { continue } } |