diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index 0453a455f4de..49e5f3413644 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -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 } }