diff --git a/app/plugin.go b/app/plugin.go index e168cddfe9..dbc29f603a 100644 --- a/app/plugin.go +++ b/app/plugin.go @@ -97,6 +97,13 @@ func (a *App) SyncPluginsActiveState() { pluginEnabled = state.Enable } + // Tie Apps proxy disabled status to the feature flag. + if pluginID == "com.mattermost.apps" { + if !a.Config().FeatureFlags.AppsEnabled { + pluginEnabled = false + } + } + if pluginEnabled { enabledPlugins = append(enabledPlugins, plugin) } else { diff --git a/app/plugin_install.go b/app/plugin_install.go index a30065bed8..f0e4b7a3d0 100644 --- a/app/plugin_install.go +++ b/app/plugin_install.go @@ -373,6 +373,9 @@ func (a *App) installExtractedPlugin(manifest *model.Manifest, fromPluginDir str // Activate the plugin if enabled. pluginState := a.Config().PluginSettings.PluginStates[manifest.Id] if pluginState != nil && pluginState.Enable { + if manifest.Id == "com.mattermost.apps" && !a.Config().FeatureFlags.AppsEnabled { + return manifest, nil + } updatedManifest, _, err := pluginsEnvironment.Activate(manifest.Id) if err != nil { return nil, model.NewAppError("installExtractedPlugin", "app.plugin.restart.app_error", nil, err.Error(), http.StatusInternalServerError) diff --git a/model/feature_flags.go b/model/feature_flags.go index 252fa212d8..cdcf87dab7 100644 --- a/model/feature_flags.go +++ b/model/feature_flags.go @@ -19,8 +19,13 @@ type FeatureFlags struct { // Toggle on and off support for Collapsed Threads CollapsedThreads bool + // AppsEnabled toggle the Apps framework functionalities both in server and client side + AppsEnabled bool + // Feature flags to control plugin versions PluginIncidentManagement string `plugin_id:"com.mattermost.plugin-incident-management"` + PluginApps string `plugin_id:"com.mattermost.apps"` + // Toggle on and off support for Files search FilesSearch bool // Feature flag to control setting the TCP_NO_DELAY setting for websockets. @@ -33,7 +38,10 @@ func (f *FeatureFlags) SetDefaults() { f.CloudDelinquentEmailJobsEnabled = false f.CollapsedThreads = false f.FilesSearch = false + f.AppsEnabled = false + f.PluginIncidentManagement = "1.7.0" + f.PluginApps = "" f.WebSocketDelay = false }