Этот коммит содержится в:
Nathaniel Allred
2022-06-17 11:13:22 -05:00
коммит произвёл GitHub
родитель 18c8a2bb53
Коммит d43c06ea75
11 изменённых файлов: 9 добавлений и 146 удалений

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

@@ -68,7 +68,7 @@ type AppIface interface {
// If includeRemovedMembers is true, then channel members who left or were removed from the channel will
// be included; otherwise, they will be excluded.
ChannelMembersToAdd(since int64, channelID *string, includeRemovedMembers bool) ([]*model.UserChannelIDPair, *model.AppError)
// CheckFreemiumLimitsForConfigSave returns an error if the configuration being saved violates the Cloud Freemium limits
// CheckFreemiumLimitsForConfigSave returns an error if the configuration being saved violates a cloud plan's limits
CheckFreemiumLimitsForConfigSave(oldConfig, newConfig *model.Config) *model.AppError
// CheckProviderAttributes returns the empty string if the patch can be applied without
// overriding attributes set by the user's login provider; otherwise, the name of the offending

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

@@ -70,10 +70,6 @@ func (ch *Channels) getInstalledIntegrations() ([]*model.InstalledIntegration, *
}
func (a *App) checkIfIntegrationsMeetFreemiumLimits(originalPluginIds []string) *model.AppError {
if !a.Config().FeatureFlags.CloudFree {
return nil
}
if a.License() == nil || !*a.License().Features.Cloud {
return nil
}

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

@@ -973,9 +973,6 @@ func TestEnablePluginWithCloudLimits(t *testing.T) {
th := Setup(t)
defer th.TearDown()
os.Setenv("MM_FEATUREFLAGS_CLOUDFREE", "true")
defer os.Unsetenv("MM_FEATUREFLAGS_CLOUDFREE")
th.App.ReloadConfig()
th.App.Srv().SetLicense(model.NewTestLicense("cloud"))
th.App.UpdateConfig(func(cfg *model.Config) {
@@ -1033,15 +1030,6 @@ func TestEnablePluginWithCloudLimits(t *testing.T) {
appErr = th.App.EnablePlugin("testplugin2")
checkError(t, appErr)
os.Unsetenv("MM_FEATUREFLAGS_CLOUDFREE")
th.App.ReloadConfig()
appErr = th.App.EnablePlugin("testplugin2")
checkNoError(t, appErr)
os.Setenv("MM_FEATUREFLAGS_CLOUDFREE", "true")
th.App.ReloadConfig()
appErr = th.App.EnablePlugin("testplugin2")
checkError(t, appErr)
// Let enable succeed if a CWS error occurs
cloud = &mocks.CloudInterface{}
th.App.Srv().Cloud = cloud

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

@@ -10,12 +10,8 @@ import (
"github.com/mattermost/mattermost-server/v6/utils"
)
// CheckFreemiumLimitsForConfigSave returns an error if the configuration being saved violates the Cloud Freemium limits
// CheckFreemiumLimitsForConfigSave returns an error if the configuration being saved violates a cloud plan's limits
func (a *App) CheckFreemiumLimitsForConfigSave(oldConfig, newConfig *model.Config) *model.AppError {
if !a.Config().FeatureFlags.CloudFree {
return nil
}
appErr := a.checkIntegrationLimitsForConfigSave(oldConfig, newConfig)
if appErr != nil {
return appErr