From c26edcf6786fd8aa1535c09e9581fc6417cddda4 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 14 Jan 2016 08:23:48 -0500 Subject: Final updates --- model/license.go | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'model') diff --git a/model/license.go b/model/license.go index 20e49d668..a271b46b7 100644 --- a/model/license.go +++ b/model/license.go @@ -26,9 +26,26 @@ type Customer struct { } type Features struct { - Users int `json:"users"` - LDAP bool `json:"ldap"` - GoogleSSO bool `json:"google_sso"` + Users *int `json:"users"` + LDAP *bool `json:"ldap"` + GoogleSSO *bool `json:"google_sso"` +} + +func (f *Features) SetDefaults() { + if f.Users == nil { + f.Users = new(int) + *f.Users = 0 + } + + if f.LDAP == nil { + f.LDAP = new(bool) + *f.LDAP = true + } + + if f.GoogleSSO == nil { + f.GoogleSSO = new(bool) + *f.GoogleSSO = true + } } func (l *License) IsExpired() bool { -- cgit v1.2.3-1-g7c22