mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Respect email privacy option in user search via API (#4512)
* respect user's email privacy option * make email visible to admin irrespective of privacy option
This commit is contained in:
		@@ -60,7 +60,7 @@ func Search(ctx *context.APIContext) {
 | 
			
		||||
			AvatarURL: users[i].AvatarLink(),
 | 
			
		||||
			FullName:  markup.Sanitize(users[i].FullName),
 | 
			
		||||
		}
 | 
			
		||||
		if ctx.IsSigned {
 | 
			
		||||
		if ctx.IsSigned && (!users[i].KeepEmailPrivate || ctx.User.IsAdmin) {
 | 
			
		||||
			results[i].Email = users[i].Email
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user