diff options
author | Unknwon <u@gogs.io> | 2017-01-03 11:02:14 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-01-03 11:02:14 +0800 |
commit | e8c3e9bcf87aa94497561e52e3cd5a15990a3037 (patch) | |
tree | 4ee5d614b2619812aab113bd2ad395be4f0a0bb3 /routers/repo | |
parent | cdfcef04a1574941f056982018ed4435f017deef (diff) |
Improve code for fix of #4006
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/pull.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index b28dd591..fe606010 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -49,8 +49,7 @@ func getForkRepository(ctx *context.Context) *models.Repository { return nil } - hasAccess, _ := models.HasAccess(ctx.User, forkRepo, models.ACCESS_MODE_READ) - if !hasAccess || !forkRepo.CanBeForked() { + if !forkRepo.CanBeForked() || !forkRepo.HasAccess(ctx.User) { ctx.Handle(404, "getForkRepository", nil) return nil } |