1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-03 08:55:20 +02:00

Fix org visibility bug when git cloning (#6743)

* 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 02:59:10 +08:00 committed by Lauris BH
parent e8f4c7733a
commit 199faadea3
87 changed files with 2865 additions and 14 deletions

View file

@ -164,6 +164,15 @@ func getUserRepoPermission(e Engine, repo *Repository, user *User) (perm Permiss
return
}
if repo.Owner == nil {
repo.mustOwner(e)
}
if repo.Owner.IsOrganization() && !HasOrgVisible(repo.Owner, user) {
perm.AccessMode = AccessModeNone
return
}
if err = repo.getUnits(e); err != nil {
return
}