diff options
author | JoramWilander <jwawilander@gmail.com> | 2016-01-14 08:23:48 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2016-01-14 08:24:09 -0500 |
commit | c26edcf6786fd8aa1535c09e9581fc6417cddda4 (patch) | |
tree | d8283b12c2a1b14c18da4ae446f5c2ca0e5d0af5 /model/license.go | |
parent | 22c522178ce5a4b9e9533d91dd77518a2899f2b0 (diff) | |
download | chat-c26edcf6786fd8aa1535c09e9581fc6417cddda4.tar.gz chat-c26edcf6786fd8aa1535c09e9581fc6417cddda4.tar.bz2 chat-c26edcf6786fd8aa1535c09e9581fc6417cddda4.zip |
Final updates
Diffstat (limited to 'model/license.go')
-rw-r--r-- | model/license.go | 23 |
1 files changed, 20 insertions, 3 deletions
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 { |