Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Michael Kochell
2022-05-25 12:36:08 -04:00
коммит произвёл GitHub
родитель 54a88fb532
Коммит ea5bfe3fd9
22 изменённых файлов: 634 добавлений и 22 удалений

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

@@ -152,6 +152,11 @@ func updateConfig(c *Context, w http.ResponseWriter, r *http.Request) {
*cfg.PluginSettings.MarketplaceURL = *appCfg.PluginSettings.MarketplaceURL
}
if err := c.App.CheckFreemiumLimitsForConfigSave(appCfg, cfg); err != nil {
c.Err = err
return
}
// There are some settings that cannot be changed in a cloud env
if c.App.Channels().License() != nil && *c.App.Channels().License().Features.Cloud {
// Both of them cannot be nil since cfg.SetDefaults is called earlier for cfg,
@@ -286,6 +291,11 @@ func patchConfig(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
if err := c.App.CheckFreemiumLimitsForConfigSave(appCfg, cfg); err != nil {
c.Err = err
return
}
// There are some settings that cannot be changed in a cloud env
if c.App.Channels().License() != nil && *c.App.Channels().License().Features.Cloud {
if cfg.ComplianceSettings.Directory != nil && *appCfg.ComplianceSettings.Directory != *cfg.ComplianceSettings.Directory {