mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix SQL Query for SearchTeam (#20844)
				
					
				
			- Currently the function takes in the `UserID` option, but isn't being used within the SQL query. This patch fixes that by checking that only teams are being returned that the user belongs to. Fix #20829 Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
		@@ -339,7 +339,7 @@ func SearchTeam(ctx *context.Context) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	opts := &organization.SearchTeamOptions{
 | 
			
		||||
		UserID:      ctx.Doer.ID,
 | 
			
		||||
		// UserID is not set because the router already requires the doer to be an org admin. Thus, we don't need to restrict to teams that the user belongs in
 | 
			
		||||
		Keyword:     ctx.FormTrim("q"),
 | 
			
		||||
		OrgID:       ctx.Org.Organization.ID,
 | 
			
		||||
		IncludeDesc: ctx.FormString("include_desc") == "" || ctx.FormBool("include_desc"),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user