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