mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	* Fix #6234 : Check organization visibility before everything else * Ensure that Owner is available in the Repo
This commit is contained in:
		@@ -212,6 +212,17 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func repoAssignment(ctx *Context, repo *models.Repository) {
 | 
					func repoAssignment(ctx *Context, repo *models.Repository) {
 | 
				
			||||||
	var err error
 | 
						var err error
 | 
				
			||||||
 | 
						if err = repo.GetOwner(); err != nil {
 | 
				
			||||||
 | 
							ctx.ServerError("GetOwner", err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if repo.Owner.IsOrganization() {
 | 
				
			||||||
 | 
							if !models.HasOrgVisible(repo.Owner, ctx.User) {
 | 
				
			||||||
 | 
								ctx.NotFound("HasOrgVisible", nil)
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	ctx.Repo.Permission, err = models.GetUserRepoPermission(repo, ctx.User)
 | 
						ctx.Repo.Permission, err = models.GetUserRepoPermission(repo, ctx.User)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		ctx.ServerError("GetUserRepoPermission", err)
 | 
							ctx.ServerError("GetUserRepoPermission", err)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user