1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix org visibility bug when git cloning (#6743) (#6762)

* fix org visibility bug

* fix permission check

* add integration tests

* fix tests

* change test user name for easier maintainance and fix test

* fix test git repo name
This commit is contained in:
Lunny Xiao
2019-04-26 20:02:27 +08:00
committed by Lauris BH
parent e6cd4f3276
commit 81adf6ad86
88 changed files with 2873 additions and 22 deletions

View File

@@ -150,6 +150,7 @@ func repoAssignment() macaron.Handler {
}
return
}
repo.Owner = owner
ctx.Repo.Repository = repo

View File

@@ -365,11 +365,6 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
// Home render repository home page
func Home(ctx *context.Context) {
if !models.HasOrgVisible(ctx.Repo.Repository.Owner, ctx.User) {
ctx.NotFound("HasOrgVisible", nil)
return
}
if len(ctx.Repo.Units) > 0 {
var firstUnit *models.Unit
for _, repoUnit := range ctx.Repo.Units {