MM-21290: Adds licensing feature for LockTeammateNameDisplay. (#13431)

This commit is contained in:
Martin Kraft
2019-12-27 17:24:34 -05:00
committed by GitHub
parent f2a14ae976
commit f8d31def8e
2 changed files with 7 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ type Features struct {
CustomTermsOfService *bool `json:"custom_terms_of_service"`
GuestAccountsPermissions *bool `json:"guest_accounts_permissions"`
IDLoadedPushNotifications *bool `json:"id_loaded"`
LockTeammateNameDisplay *bool `json:"lock_teammate_name_display"`
// after we enabled more features we'll need to control them with this
FutureFeatures *bool `json:"future_features"`
@@ -85,6 +86,7 @@ func (f *Features) ToMap() map[string]interface{} {
"custom_permissions_schemes": *f.CustomPermissionsSchemes,
"guest_accounts_permissions": *f.GuestAccountsPermissions,
"id_loaded": *f.IDLoadedPushNotifications,
"lock_teammate_name_display": *f.LockTeammateNameDisplay,
"future": *f.FutureFeatures,
}
}
@@ -177,6 +179,10 @@ func (f *Features) SetDefaults() {
if f.IDLoadedPushNotifications == nil {
f.IDLoadedPushNotifications = NewBool(*f.FutureFeatures)
}
if f.LockTeammateNameDisplay == nil {
f.LockTeammateNameDisplay = NewBool(*f.FutureFeatures)
}
}
func (l *License) IsExpired() bool {

View File

@@ -157,6 +157,7 @@ func GetClientLicense(l *model.License) map[string]string {
props["CustomPermissionsSchemes"] = strconv.FormatBool(*l.Features.CustomPermissionsSchemes)
props["GuestAccountsPermissions"] = strconv.FormatBool(*l.Features.GuestAccountsPermissions)
props["CustomTermsOfService"] = strconv.FormatBool(*l.Features.CustomTermsOfService)
props["LockTeammateNameDisplay"] = strconv.FormatBool(*l.Features.LockTeammateNameDisplay)
}
return props