[CLD-7046] Ability to disable self hosted server-side requests to CWS (#26070)
* Add 'Disable' config to CloudSettings to prevent the CWS backend from making calls to the Customer Portal * Add custom error when disabled * Make Disable setting cloud_restrictable * Return 422 instead of 400 --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -65,10 +65,15 @@ func (api *API) InitCloud() {
|
||||
|
||||
func ensureCloudInterface(c *Context, where string) bool {
|
||||
cloud := c.App.Cloud()
|
||||
disabled := c.App.Config().CloudSettings.Disable != nil && *c.App.Config().CloudSettings.Disable
|
||||
if cloud == nil {
|
||||
c.Err = model.NewAppError(where, "api.server.cws.needs_enterprise_edition", nil, "", http.StatusBadRequest)
|
||||
return false
|
||||
}
|
||||
if disabled {
|
||||
c.Err = model.NewAppError(where, "api.server.cws.disabled", nil, "", http.StatusUnprocessableEntity)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user