MM-10980: Conditionally filteres User json properties. (#9018)

Этот коммит содержится в:
Martin Kraft
2018-06-29 08:45:04 -04:00
коммит произвёл Joram Wilander
родитель e51ae39766
Коммит 56ba06c016
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@@ -154,7 +154,11 @@ func getUserByUsername(c *Context, w http.ResponseWriter, r *http.Request) {
if c.HandleEtag(etag, "Get User", w, r) {
return
} else {
c.App.SanitizeProfile(user, c.IsSystemAdmin())
if c.Session.UserId == user.Id {
user.Sanitize(map[string]bool{})
} else {
c.App.SanitizeProfile(user, c.IsSystemAdmin())
}
w.Header().Set(model.HEADER_ETAG_SERVER, etag)
w.Write([]byte(user.ToJson()))
return