summaryrefslogtreecommitdiffstats
path: root/api4/user.go
diff options
context:
space:
mode:
authorMartin Kraft <mkraft@users.noreply.github.com>2018-06-29 08:45:04 -0400
committerJoram Wilander <jwawilander@gmail.com>2018-06-29 08:45:04 -0400
commit56ba06c0166f46e9fcfcc4f654a3f7346244b5a9 (patch)
tree394da528f922b1d4377ebc8504aaadd53f683f75 /api4/user.go
parente51ae397664b6c2b04bfa263429da550240d160e (diff)
downloadchat-56ba06c0166f46e9fcfcc4f654a3f7346244b5a9.tar.gz
chat-56ba06c0166f46e9fcfcc4f654a3f7346244b5a9.tar.bz2
chat-56ba06c0166f46e9fcfcc4f654a3f7346244b5a9.zip
MM-10980: Conditionally filteres User json properties. (#9018)
Diffstat (limited to 'api4/user.go')
-rw-r--r--api4/user.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/api4/user.go b/api4/user.go
index 14ab3a0a2..ac702644d 100644
--- a/api4/user.go
+++ b/api4/user.go
@@ -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