summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go41
1 files changed, 31 insertions, 10 deletions
diff --git a/utils/config.go b/utils/config.go
index 46daf203c..36193412b 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -31,6 +31,7 @@ type ServiceSettings struct {
UseLocalStorage bool
StorageDirectory string
AllowedLoginAttempts int
+ AllowEmailSignUp bool
}
type SSOSetting struct {
@@ -109,16 +110,18 @@ type PrivacySettings struct {
}
type TeamSettings struct {
- MaxUsersPerTeam int
- AllowPublicLink bool
- AllowValetDefault bool
- TermsLink string
- PrivacyLink string
- AboutLink string
- HelpLink string
- ReportProblemLink string
- TourLink string
- DefaultThemeColor string
+ MaxUsersPerTeam int
+ AllowPublicLink bool
+ AllowValetDefault bool
+ TermsLink string
+ PrivacyLink string
+ AboutLink string
+ HelpLink string
+ ReportProblemLink string
+ TourLink string
+ DefaultThemeColor string
+ DisableTeamCreation bool
+ RestrictCreationToDomains string
}
type Config struct {
@@ -275,5 +278,23 @@ func GetAllowedAuthServices() []string {
}
}
+ if Cfg.ServiceSettings.AllowEmailSignUp {
+ authServices = append(authServices, "email")
+ }
+
return authServices
}
+
+func IsServiceAllowed(s string) bool {
+ if len(s) == 0 {
+ return false
+ }
+
+ if service, ok := Cfg.SSOSettings[s]; ok {
+ if service.Allow {
+ return true
+ }
+ }
+
+ return false
+}