mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-27930 - Cloud license feature (#15297)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user