2023-02-19 21:42:01 +05:30
|
|
|
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
package setting
|
|
|
|
|
2024-03-29 20:35:41 +05:30
|
|
|
import (
|
|
|
|
"code.gitea.io/gitea/modules/container"
|
|
|
|
)
|
2024-02-23 12:54:04 +05:30
|
|
|
|
2023-02-19 21:42:01 +05:30
|
|
|
// Admin settings
|
|
|
|
var Admin struct {
|
2023-09-07 12:41:29 +05:30
|
|
|
DisableRegularOrgCreation bool
|
|
|
|
DefaultEmailNotification string
|
|
|
|
SendNotificationEmailOnNewUser bool
|
2024-02-23 12:54:04 +05:30
|
|
|
UserDisabledFeatures container.Set[string]
|
2024-03-29 20:35:41 +05:30
|
|
|
ExternalUserDisableFeatures container.Set[string]
|
2023-02-19 21:42:01 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
func loadAdminFrom(rootCfg ConfigProvider) {
|
|
|
|
sec := rootCfg.Section("admin")
|
2024-02-23 12:54:04 +05:30
|
|
|
Admin.DisableRegularOrgCreation = sec.Key("DISABLE_REGULAR_ORG_CREATION").MustBool(false)
|
2023-02-19 21:42:01 +05:30
|
|
|
Admin.DefaultEmailNotification = sec.Key("DEFAULT_EMAIL_NOTIFICATIONS").MustString("enabled")
|
2024-02-23 12:54:04 +05:30
|
|
|
Admin.UserDisabledFeatures = container.SetOf(sec.Key("USER_DISABLED_FEATURES").Strings(",")...)
|
2024-03-29 20:35:41 +05:30
|
|
|
Admin.ExternalUserDisableFeatures = container.SetOf(sec.Key("EXTERNAL_USER_DISABLE_FEATURES").Strings(",")...)
|
2023-02-19 21:42:01 +05:30
|
|
|
}
|
2024-02-23 12:54:04 +05:30
|
|
|
|
|
|
|
const (
|
2024-03-02 06:51:01 +05:30
|
|
|
UserFeatureDeletion = "deletion"
|
2024-03-04 13:20:21 +05:30
|
|
|
UserFeatureManageSSHKeys = "manage_ssh_keys"
|
2024-03-02 06:51:01 +05:30
|
|
|
UserFeatureManageGPGKeys = "manage_gpg_keys"
|
2024-02-23 12:54:04 +05:30
|
|
|
)
|