From 6982a61f69a0bf1e293a97cdd24ad7f1bc4e0058 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 15 Jun 2015 08:45:02 -0400 Subject: fixes mm-1239 adds config setting to turn off valet feature --- api/post.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 25a68304d..0d0f2c4cf 100644 --- a/api/post.go +++ b/api/post.go @@ -58,6 +58,11 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) { } func createValetPost(c *Context, w http.ResponseWriter, r *http.Request) { + if !utils.Cfg.TeamSettings.AllowValet { + c.Err = model.NewAppError("createValetPost", "The valet feature is currently turned off. Please contact your system administrator for details.", "") + c.Err.StatusCode = http.StatusNotImplemented + } + post := model.PostFromJson(r.Body) if post == nil { c.SetInvalidParam("createValetPost", "post") -- cgit v1.2.3-1-g7c22 From a281e962fc88bf1c5c26539f8a819cf7a8558a8a Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 15 Jun 2015 09:06:55 -0400 Subject: update unit test --- api/post.go | 1 + 1 file changed, 1 insertion(+) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 0d0f2c4cf..36607c231 100644 --- a/api/post.go +++ b/api/post.go @@ -61,6 +61,7 @@ func createValetPost(c *Context, w http.ResponseWriter, r *http.Request) { if !utils.Cfg.TeamSettings.AllowValet { c.Err = model.NewAppError("createValetPost", "The valet feature is currently turned off. Please contact your system administrator for details.", "") c.Err.StatusCode = http.StatusNotImplemented + return } post := model.PostFromJson(r.Body) -- cgit v1.2.3-1-g7c22