mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08: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:
		@@ -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
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user