aboutsummaryrefslogtreecommitdiff
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-01-03 11:02:14 +0800
committerUnknwon <u@gogs.io>2017-01-03 11:02:14 +0800
commite8c3e9bcf87aa94497561e52e3cd5a15990a3037 (patch)
tree4ee5d614b2619812aab113bd2ad395be4f0a0bb3 /routers/repo
parentcdfcef04a1574941f056982018ed4435f017deef (diff)
Improve code for fix of #4006
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/pull.go3
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
}