diff options
author | George Goldberg <george@gberg.me> | 2018-05-22 19:06:14 +0100 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-05-22 11:06:14 -0700 |
commit | 8fb070fecfbb91f22c6f540ecf0b77fb8be42ab2 (patch) | |
tree | a81061077e5b4241e0241b18f1badeba9c10266f /app/webhook.go | |
parent | 1af1bce6199597bb2d41ddcdc00ef0f28a73c83e (diff) | |
download | chat-8fb070fecfbb91f22c6f540ecf0b77fb8be42ab2.tar.gz chat-8fb070fecfbb91f22c6f540ecf0b77fb8be42ab2.tar.bz2 chat-8fb070fecfbb91f22c6f540ecf0b77fb8be42ab2.zip |
MM-10352: Add locking incoming webhooks to a single channel. (#8835)
Diffstat (limited to 'app/webhook.go')
-rw-r--r-- | app/webhook.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/webhook.go b/app/webhook.go index a5ab28952..c887fec97 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -633,6 +633,10 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq } } + if hook.ChannelLocked && hook.ChannelId != channel.Id { + return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.channel_locked.app_error", nil, "", http.StatusForbidden) + } + if a.License() != nil && *a.Config().TeamSettings.ExperimentalTownSquareIsReadOnly && channel.Name == model.DEFAULT_CHANNEL { return model.NewAppError("HandleIncomingWebhook", "api.post.create_post.town_square_read_only", nil, "", http.StatusForbidden) |