Inlcude team Id for fake context for incoming webhooks (#2988)

This commit is contained in:
Joram Wilander
2016-05-12 21:36:15 -04:00
committed by Corey Hulen
parent 4f22cbc92b
commit e46c1b8d52

View File

@@ -434,6 +434,8 @@ func incomingWebhook(c *Context, w http.ResponseWriter, r *http.Request) {
IsOAuth: false,
}
c.TeamId = hook.TeamId
if !c.HasPermissionsToChannel(pchan, "createIncomingHook") && channel.Type != model.CHANNEL_OPEN {
c.Err = model.NewLocAppError("incomingWebhook", "web.incoming_webhook.permissions.app_error", nil, "")
return