From 8fb070fecfbb91f22c6f540ecf0b77fb8be42ab2 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Tue, 22 May 2018 19:06:14 +0100 Subject: MM-10352: Add locking incoming webhooks to a single channel. (#8835) --- app/webhook.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/webhook.go') 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) -- cgit v1.2.3-1-g7c22