MM-47249: Blocklist focalboard plugin in product mode (#21243)

We prevent the plugin from starting if in product mode,
and also give pretty errors to make it clear to the users.

https://mattermost.atlassian.net/browse/MM-47249

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2022-10-08 10:21:22 +05:30
коммит произвёл GitHub
родитель a28183b078
Коммит 9bf94bf6c1
4 изменённых файлов: 33 добавлений и 3 удалений

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

@@ -156,6 +156,11 @@ func updateConfig(c *Context, w http.ResponseWriter, r *http.Request) {
*cfg.PluginSettings.MarketplaceURL = *appCfg.PluginSettings.MarketplaceURL
}
if cfg.PluginSettings.PluginStates[model.PluginIdFocalboard].Enable && cfg.FeatureFlags.BoardsProduct {
c.Err = model.NewAppError("EnablePlugin", "app.plugin.product_mode.app_error", map[string]any{"Name": model.PluginIdFocalboard}, "", http.StatusInternalServerError)
return
}
if appErr := c.App.CheckFreemiumLimitsForConfigSave(appCfg, cfg); appErr != nil {
c.Err = appErr
return