diff options
author | Corey Hulen <corey@hulen.com> | 2015-06-15 10:01:37 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-06-15 10:01:37 -0800 |
commit | 61eac918b74494b085ff1863a027aa79437ed1ac (patch) | |
tree | edda731dd6d589abe98e025b437952d37d83eeaa /api/post.go | |
parent | c068d40c172af90fad36780b1186d72d593cbfa8 (diff) | |
parent | e774a67e33a8178c6c11e46f95da5cda28303c33 (diff) | |
download | chat-61eac918b74494b085ff1863a027aa79437ed1ac.tar.gz chat-61eac918b74494b085ff1863a027aa79437ed1ac.tar.bz2 chat-61eac918b74494b085ff1863a027aa79437ed1ac.zip |
Merge pull request #2 from mattermost/mm-1239
fixes mm-1239 adds config setting to turn off valet feature
Diffstat (limited to 'api/post.go')
-rw-r--r-- | api/post.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/post.go b/api/post.go index 25a68304d..36607c231 100644 --- a/api/post.go +++ b/api/post.go @@ -58,6 +58,12 @@ 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 + return + } + post := model.PostFromJson(r.Body) if post == nil { c.SetInvalidParam("createValetPost", "post") |