From e33ab02e1a68ace3ee6608e663fa9622da321c27 Mon Sep 17 00:00:00 2001 From: Maria A Nunez Date: Tue, 18 Aug 2020 15:47:29 -0400 Subject: [PATCH] MM-27930 - Cloud license feature (#15297) --- model/license.go | 6 ++++++ utils/license.go | 1 + 2 files changed, 7 insertions(+) diff --git a/model/license.go b/model/license.go index 365222b75ce..3de4aba83e3 100644 --- a/model/license.go +++ b/model/license.go @@ -82,6 +82,7 @@ type Features struct { LockTeammateNameDisplay *bool `json:"lock_teammate_name_display"` EnterprisePlugins *bool `json:"enterprise_plugins"` AdvancedLogging *bool `json:"advanced_logging"` + Cloud *bool `json:"cloud"` // after we enabled more features we'll need to control them with this FutureFeatures *bool `json:"future_features"` @@ -110,6 +111,7 @@ func (f *Features) ToMap() map[string]interface{} { "lock_teammate_name_display": *f.LockTeammateNameDisplay, "enterprise_plugins": *f.EnterprisePlugins, "advanced_logging": *f.AdvancedLogging, + "cloud": *f.Cloud, "future": *f.FutureFeatures, } } @@ -218,6 +220,10 @@ func (f *Features) SetDefaults() { if f.AdvancedLogging == nil { f.AdvancedLogging = NewBool(*f.FutureFeatures) } + + if f.Cloud == nil { + f.Cloud = NewBool(false) + } } func (l *License) IsExpired() bool { diff --git a/utils/license.go b/utils/license.go index 4646e7f58eb..b4b350cad73 100644 --- a/utils/license.go +++ b/utils/license.go @@ -158,6 +158,7 @@ func GetClientLicense(l *model.License) map[string]string { props["GuestAccountsPermissions"] = strconv.FormatBool(*l.Features.GuestAccountsPermissions) props["CustomTermsOfService"] = strconv.FormatBool(*l.Features.CustomTermsOfService) props["LockTeammateNameDisplay"] = strconv.FormatBool(*l.Features.LockTeammateNameDisplay) + props["Cloud"] = strconv.FormatBool(*l.Features.Cloud) } return props