MM-37417: Push notification authz fix. (#18009)

* MM-37417: Push notification authz fix.

* MM-37417: Tests new app method.
Этот коммит содержится в:
Martin Kraft
2021-07-28 13:47:45 -04:00
коммит произвёл GitHub
родитель 285de45988
Коммит 37b1e6d048
7 изменённых файлов: 99 добавлений и 34 удалений

Просмотреть файл

@@ -513,6 +513,11 @@ func pushNotificationAck(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if _, appErr := c.App.GetPostIfAuthorized(ack.PostId, c.AppContext.Session()); appErr != nil {
c.Err = appErr
return
}
if !*c.App.Config().EmailSettings.SendPushNotifications {
c.Err = model.NewAppError("pushNotificationAck", "api.push_notification.disabled.app_error", nil, "", http.StatusNotImplemented)
return