summaryrefslogtreecommitdiffstats
path: root/api4/team.go
diff options
context:
space:
mode:
authorChristopher Brown <ccbrown112@gmail.com>2017-10-16 23:10:45 -0500
committerChristopher Brown <ccbrown112@gmail.com>2017-10-16 23:10:45 -0500
commit39cc2372695836fdc96059d8b94992b1416f98e1 (patch)
tree56d2beb5420cd0054194f71e53c6a95578beff9a /api4/team.go
parent89dc3cb126ba46b486997c433adfdf34982fcc81 (diff)
parent8bf47c1211d09079fd9407555026b7b29383ac37 (diff)
downloadchat-39cc2372695836fdc96059d8b94992b1416f98e1.tar.gz
chat-39cc2372695836fdc96059d8b94992b1416f98e1.tar.bz2
chat-39cc2372695836fdc96059d8b94992b1416f98e1.zip
Merge branch 'release-4.3'
Diffstat (limited to 'api4/team.go')
-rw-r--r--api4/team.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/api4/team.go b/api4/team.go
index a94da2bef..2c60d40a1 100644
--- a/api4/team.go
+++ b/api4/team.go
@@ -71,6 +71,8 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ // Don't sanitize the team here since the user will be a team admin and their session won't reflect that yet
+
w.WriteHeader(http.StatusCreated)
w.Write([]byte(rteam.ToJson()))
}
@@ -90,6 +92,8 @@ func getTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.SanitizeTeam(c.Session, team)
+
w.Write([]byte(team.ToJson()))
return
}
@@ -110,6 +114,8 @@ func getTeamByName(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.SanitizeTeam(c.Session, team)
+
w.Write([]byte(team.ToJson()))
return
}
@@ -142,6 +148,8 @@ func updateTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.SanitizeTeam(c.Session, updatedTeam)
+
w.Write([]byte(updatedTeam.ToJson()))
}
@@ -170,6 +178,8 @@ func patchTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.SanitizeTeam(c.Session, patchedTeam)
+
c.LogAudit("")
w.Write([]byte(patchedTeam.ToJson()))
}
@@ -215,6 +225,8 @@ func getTeamsForUser(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = err
return
} else {
+ app.SanitizeTeams(c.Session, teams)
+
w.Write([]byte(model.TeamListToJson(teams)))
}
}
@@ -541,6 +553,8 @@ func getAllTeams(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.SanitizeTeams(c.Session, teams)
+
w.Write([]byte(model.TeamListToJson(teams)))
}
@@ -570,6 +584,8 @@ func searchTeams(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.SanitizeTeams(c.Session, teams)
+
w.Write([]byte(model.TeamListToJson(teams)))
}