diff --git a/app/plugin.go b/app/plugin.go index 2791d887a3..02e73b6543 100644 --- a/app/plugin.go +++ b/app/plugin.go @@ -720,7 +720,7 @@ func (s *Server) getBaseMarketplaceFilter() *model.MarketplacePluginFilter { } license := s.License() - if license != nil && *license.Features.EnterprisePlugins { + if license != nil && license.HasEnterpriseMarketplacePlugins() { filter.EnterprisePlugins = true } diff --git a/model/license.go b/model/license.go index d424a6d39d..cbdcf6d38c 100644 --- a/model/license.go +++ b/model/license.go @@ -16,6 +16,11 @@ const ( InvalidLicenseError = "api.license.add_license.invalid.app_error" LicenseGracePeriod = 1000 * 60 * 60 * 24 * 10 //10 days LicenseRenewalLink = "https://mattermost.com/renew/" + + LicenseShortSkuE10 = "E10" + LicenseShortSkuE20 = "E20" + LicenseShortSkuProfessional = "professional" + LicenseShortSkuEnterprise = "enterprise" ) const ( @@ -302,6 +307,13 @@ func (l *License) IsSanctionedTrial() bool { (duration >= sanctionedTrialDurationLowerBound.Milliseconds() || duration <= sanctionedTrialDurationUpperBound.Milliseconds()) } +func (l *License) HasEnterpriseMarketplacePlugins() bool { + return *l.Features.EnterprisePlugins || + l.SkuShortName == LicenseShortSkuE20 || + l.SkuShortName == LicenseShortSkuProfessional || + l.SkuShortName == LicenseShortSkuEnterprise +} + // NewTestLicense returns a license that expires in the future and has the given features. func NewTestLicense(features ...string) *License { ret := &License{