diff options
Diffstat (limited to 'api4/team.go')
-rw-r--r-- | api4/team.go | 16 |
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))) } |