diff options
author | Martin Kraft <martinkraft@gmail.com> | 2018-05-22 12:54:00 -0400 |
---|---|---|
committer | Martin Kraft <martinkraft@gmail.com> | 2018-05-22 12:54:00 -0400 |
commit | 4c683aff7627040ff811f065848a820b2cb19d59 (patch) | |
tree | 668061e8acfd8827fd02bab18a998b7986944296 /model/config.go | |
parent | eb78d273f39202046fa71555a5a19b0ec8a95cb3 (diff) | |
parent | 1af1bce6199597bb2d41ddcdc00ef0f28a73c83e (diff) | |
download | chat-4c683aff7627040ff811f065848a820b2cb19d59.tar.gz chat-4c683aff7627040ff811f065848a820b2cb19d59.tar.bz2 chat-4c683aff7627040ff811f065848a820b2cb19d59.zip |
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/model/config.go b/model/config.go index a5a588a82..4710658ec 100644 --- a/model/config.go +++ b/model/config.go @@ -224,6 +224,7 @@ type ServiceSettings struct { ImageProxyType *string ImageProxyURL *string ImageProxyOptions *string + EnableAPITeamDeletion *bool } func (s *ServiceSettings) SetDefaults() { @@ -452,6 +453,10 @@ func (s *ServiceSettings) SetDefaults() { if s.ImageProxyOptions == nil { s.ImageProxyOptions = NewString("") } + + if s.EnableAPITeamDeletion == nil { + s.EnableAPITeamDeletion = NewBool(false) + } } type ClusterSettings struct { @@ -975,7 +980,7 @@ type TeamSettings struct { SiteName string MaxUsersPerTeam *int EnableTeamCreation *bool - EnableUserCreation bool + EnableUserCreation *bool EnableOpenServer *bool RestrictCreationToDomains string EnableCustomBrand *bool @@ -1106,6 +1111,11 @@ func (s *TeamSettings) SetDefaults() { if s.EnableTeamCreation == nil { s.EnableTeamCreation = NewBool(true) } + + if s.EnableUserCreation == nil { + s.EnableUserCreation = NewBool(true) + } + } type ClientRequirements struct { @@ -1860,18 +1870,10 @@ func (o *Config) SetDefaults() { } func (o *Config) IsValid() *AppError { - if len(*o.ServiceSettings.SiteURL) == 0 && *o.EmailSettings.EnableEmailBatching { - return NewAppError("Config.IsValid", "model.config.is_valid.site_url_email_batching.app_error", nil, "", http.StatusBadRequest) - } - if *o.ClusterSettings.Enable && *o.EmailSettings.EnableEmailBatching { return NewAppError("Config.IsValid", "model.config.is_valid.cluster_email_batching.app_error", nil, "", http.StatusBadRequest) } - if len(*o.ServiceSettings.SiteURL) == 0 && *o.ServiceSettings.AllowCookiesForSubdomains { - return NewAppError("Config.IsValid", "Allowing cookies for subdomains requires SiteURL to be set.", nil, "", http.StatusBadRequest) - } - if err := o.TeamSettings.isValid(); err != nil { return err } @@ -2177,12 +2179,6 @@ func (ss *ServiceSettings) isValid() *AppError { return NewAppError("Config.IsValid", "model.config.is_valid.login_attempts.app_error", nil, "", http.StatusBadRequest) } - if len(*ss.SiteURL) != 0 { - if _, err := url.ParseRequestURI(*ss.SiteURL); err != nil { - return NewAppError("Config.IsValid", "model.config.is_valid.site_url.app_error", nil, "", http.StatusBadRequest) - } - } - if len(*ss.WebsocketURL) != 0 { if _, err := url.ParseRequestURI(*ss.WebsocketURL); err != nil { return NewAppError("Config.IsValid", "model.config.is_valid.websocket_url.app_error", nil, "", http.StatusBadRequest) |