From 08a3cf6b38fd8fdac3b5f7176133bc1a248bc8fc Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 3 May 2016 11:54:49 -0400 Subject: Port HPNS from 2.2 to master (#2863) --- model/license.go | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'model/license.go') diff --git a/model/license.go b/model/license.go index 0cea67c3d..bc72ff9ad 100644 --- a/model/license.go +++ b/model/license.go @@ -32,15 +32,22 @@ type Customer struct { } type Features struct { - Users *int `json:"users"` - LDAP *bool `json:"ldap"` - MFA *bool `json:"mfa"` - GoogleSSO *bool `json:"google_sso"` - Compliance *bool `json:"compliance"` - CustomBrand *bool `json:"custom_brand"` + Users *int `json:"users"` + LDAP *bool `json:"ldap"` + MFA *bool `json:"mfa"` + GoogleSSO *bool `json:"google_sso"` + Compliance *bool `json:"compliance"` + CustomBrand *bool `json:"custom_brand"` + MHPNS *bool `json:"mhpns"` + FutureFeatures *bool `json:"future_features"` } func (f *Features) SetDefaults() { + if f.FutureFeatures == nil { + f.FutureFeatures = new(bool) + *f.FutureFeatures = true + } + if f.Users == nil { f.Users = new(int) *f.Users = 0 @@ -48,27 +55,32 @@ func (f *Features) SetDefaults() { if f.LDAP == nil { f.LDAP = new(bool) - *f.LDAP = true + *f.LDAP = *f.FutureFeatures } if f.MFA == nil { f.MFA = new(bool) - *f.MFA = true + *f.MFA = *f.FutureFeatures } if f.GoogleSSO == nil { f.GoogleSSO = new(bool) - *f.GoogleSSO = true + *f.GoogleSSO = *f.FutureFeatures } if f.Compliance == nil { f.Compliance = new(bool) - *f.Compliance = true + *f.Compliance = *f.FutureFeatures } if f.CustomBrand == nil { f.CustomBrand = new(bool) - *f.CustomBrand = true + *f.CustomBrand = *f.FutureFeatures + } + + if f.MHPNS == nil { + f.MHPNS = new(bool) + *f.MHPNS = *f.FutureFeatures } } -- cgit v1.2.3-1-g7c22