MM-27930 - Cloud license feature (#15297)

This commit is contained in:
Maria A Nunez
2020-08-18 15:47:29 -04:00
committed by GitHub
parent f6bce5b32a
commit e33ab02e1a
2 changed files with 7 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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