MM-47936: Removes CustomGroups feature flag. (#21739)
* MM-47936: Removes CustomGroups feature flag. * MM-47936: Updates godoc.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6965585aa8
Коммит
62d9218011
@@ -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 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
|
source = model.GroupSourceLdap
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1328,8 +1328,6 @@ func deleteGroupMembers(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
//
|
//
|
||||||
// err := licensedAndConfiguredForGroupBySource(c.App, group.Source)
|
// err := licensedAndConfiguredForGroupBySource(c.App, group.Source)
|
||||||
// err.Where = "Api4.getGroup"
|
// err.Where = "Api4.getGroup"
|
||||||
//
|
|
||||||
// Temporarily, this function also checks for the CustomGroups feature flag.
|
|
||||||
func licensedAndConfiguredForGroupBySource(app app.AppIface, source model.GroupSource) *model.AppError {
|
func licensedAndConfiguredForGroupBySource(app app.AppIface, source model.GroupSource) *model.AppError {
|
||||||
lic := app.Srv().License()
|
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)
|
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)
|
return model.NewAppError("", "api.custom_groups.feature_disabled", nil, "", http.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,11 +216,7 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Custom groups professional license",
|
"Custom groups professional license",
|
||||||
&model.Config{
|
&model.Config{},
|
||||||
FeatureFlags: &model.FeatureFlags{
|
|
||||||
CustomGroups: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"",
|
"",
|
||||||
&model.License{
|
&model.License{
|
||||||
Features: &model.Features{},
|
Features: &model.Features{},
|
||||||
@@ -232,11 +228,7 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Custom groups enterprise license",
|
"Custom groups enterprise license",
|
||||||
&model.Config{
|
&model.Config{},
|
||||||
FeatureFlags: &model.FeatureFlags{
|
|
||||||
CustomGroups: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"",
|
"",
|
||||||
&model.License{
|
&model.License{
|
||||||
Features: &model.Features{},
|
Features: &model.Features{},
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ type FeatureFlags struct {
|
|||||||
// A dash separated list for feature flags to turn on for Boards
|
// A dash separated list for feature flags to turn on for Boards
|
||||||
BoardsFeatureFlags string
|
BoardsFeatureFlags string
|
||||||
|
|
||||||
CustomGroups bool
|
|
||||||
|
|
||||||
// Enable DataRetention for Boards
|
// Enable DataRetention for Boards
|
||||||
BoardsDataRetention bool
|
BoardsDataRetention bool
|
||||||
|
|
||||||
@@ -90,7 +88,6 @@ func (f *FeatureFlags) SetDefaults() {
|
|||||||
f.PluginFocalboard = ""
|
f.PluginFocalboard = ""
|
||||||
f.PermalinkPreviews = true
|
f.PermalinkPreviews = true
|
||||||
f.BoardsFeatureFlags = ""
|
f.BoardsFeatureFlags = ""
|
||||||
f.CustomGroups = true
|
|
||||||
f.BoardsDataRetention = false
|
f.BoardsDataRetention = false
|
||||||
f.NormalizeLdapDNs = false
|
f.NormalizeLdapDNs = false
|
||||||
f.EnableInactivityCheckJob = true
|
f.EnableInactivityCheckJob = true
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user