From 62d92180114dba9e5417f96f9302053cface8bbf Mon Sep 17 00:00:00 2001 From: Martin Kraft Date: Mon, 28 Nov 2022 13:49:51 -0500 Subject: [PATCH] MM-47936: Removes CustomGroups feature flag. (#21739) * MM-47936: Removes CustomGroups feature flag. * MM-47936: Updates godoc. --- api4/group.go | 6 ++---- config/client_test.go | 12 ++---------- model/feature_flags.go | 3 --- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/api4/group.go b/api4/group.go index 78c606a448..72c78e7179 100644 --- a/api4/group.go +++ b/api4/group.go @@ -980,7 +980,7 @@ func getGroups(c *Context, w http.ResponseWriter, r *http.Request) { } // If they don't specify a source and custom groups are disabled, ensure they only get ldap groups in the response - if !c.App.Config().FeatureFlags.CustomGroups || !*c.App.Config().ServiceSettings.EnableCustomGroups { + if !*c.App.Config().ServiceSettings.EnableCustomGroups { source = model.GroupSourceLdap } @@ -1328,8 +1328,6 @@ func deleteGroupMembers(c *Context, w http.ResponseWriter, r *http.Request) { // // err := licensedAndConfiguredForGroupBySource(c.App, group.Source) // err.Where = "Api4.getGroup" -// -// Temporarily, this function also checks for the CustomGroups feature flag. func licensedAndConfiguredForGroupBySource(app app.AppIface, source model.GroupSource) *model.AppError { lic := app.Srv().License() @@ -1345,7 +1343,7 @@ func licensedAndConfiguredForGroupBySource(app app.AppIface, source model.GroupS return model.NewAppError("", "api.custom_groups.license_error", nil, "", http.StatusBadRequest) } - if source == model.GroupSourceCustom && (!app.Config().FeatureFlags.CustomGroups || !*app.Config().ServiceSettings.EnableCustomGroups) { + if source == model.GroupSourceCustom && !*app.Config().ServiceSettings.EnableCustomGroups { return model.NewAppError("", "api.custom_groups.feature_disabled", nil, "", http.StatusBadRequest) } diff --git a/config/client_test.go b/config/client_test.go index 4c23801424..a13b9cea77 100644 --- a/config/client_test.go +++ b/config/client_test.go @@ -216,11 +216,7 @@ func TestGetClientConfig(t *testing.T) { }, { "Custom groups professional license", - &model.Config{ - FeatureFlags: &model.FeatureFlags{ - CustomGroups: true, - }, - }, + &model.Config{}, "", &model.License{ Features: &model.Features{}, @@ -232,11 +228,7 @@ func TestGetClientConfig(t *testing.T) { }, { "Custom groups enterprise license", - &model.Config{ - FeatureFlags: &model.FeatureFlags{ - CustomGroups: true, - }, - }, + &model.Config{}, "", &model.License{ Features: &model.Features{}, diff --git a/model/feature_flags.go b/model/feature_flags.go index b5e9259ab8..ae1005b30d 100644 --- a/model/feature_flags.go +++ b/model/feature_flags.go @@ -39,8 +39,6 @@ type FeatureFlags struct { // A dash separated list for feature flags to turn on for Boards BoardsFeatureFlags string - CustomGroups bool - // Enable DataRetention for Boards BoardsDataRetention bool @@ -90,7 +88,6 @@ func (f *FeatureFlags) SetDefaults() { f.PluginFocalboard = "" f.PermalinkPreviews = true f.BoardsFeatureFlags = "" - f.CustomGroups = true f.BoardsDataRetention = false f.NormalizeLdapDNs = false f.EnableInactivityCheckJob = true