Browse Source

Fix incorrect logic check for fork repo action

Unknwon 8 years ago
parent
commit
cdfcef04a1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      routers/repo/pull.go

+ 2 - 1
routers/repo/pull.go

@@ -49,7 +49,8 @@ func getForkRepository(ctx *context.Context) *models.Repository {
 		return nil
 	}
 
-	if !forkRepo.CanBeForked() || !ctx.Repo.HasAccess() {
+	hasAccess, _ := models.HasAccess(ctx.User, forkRepo, models.ACCESS_MODE_READ)
+	if !hasAccess || !forkRepo.CanBeForked() {
 		ctx.Handle(404, "getForkRepository", nil)
 		return nil
 	}