mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Hide limited users if viewed by anonymous ghost (#25214)
The ghost user leads to inclusion of limited users/orgs in `BuildCanSeeUserCondition`.
This commit is contained in:
		@@ -262,6 +262,10 @@ func GetRepositories(ctx context.Context, actor *user_model.User, n int, last st
 | 
				
			|||||||
		cond = cond.And(builder.Gt{"package_property.value": strings.ToLower(last)})
 | 
							cond = cond.And(builder.Gt{"package_property.value": strings.ToLower(last)})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if actor.IsGhost() {
 | 
				
			||||||
 | 
							actor = nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cond = cond.And(user_model.BuildCanSeeUserCondition(actor))
 | 
						cond = cond.And(user_model.BuildCanSeeUserCondition(actor))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sess := db.GetEngine(ctx).
 | 
						sess := db.GetEngine(ctx).
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user