configloaders

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecuritySettingName = "adminSecurityConfig"

	FrameNone       = ""
	FrameDeny       = "DENY"
	FrameSameOrigin = "SAMEORIGIN"
)
View Source
const (
	LogSettingName = "adminLogConfig"
)

Variables

This section is empty.

Functions

func AllModuleMaps

func AllModuleMaps(langCode string) []maps.Map

AllModuleMaps 所有权限列表

func AllowModule

func AllowModule(adminId int64, module string) bool

AllowModule 检查模块是否允许访问

func CheckAdmin

func CheckAdmin(adminId int64) bool

CheckAdmin 检查用户是否存在

func FindAdminFullname

func FindAdminFullname(adminId int64) string

FindAdminFullname 查找某个管理员名称

func FindAdminLang added in v1.2.1

func FindAdminLang(adminId int64) string

FindAdminLang 查找某个管理员选择的语言

func FindAdminLangForAction added in v1.2.1

func FindAdminLangForAction(actionPtr actions.ActionWrapper) (langCode langs.LangCode)

func FindAdminTheme added in v0.2.8

func FindAdminTheme(adminId int64) string

FindAdminTheme 查找某个管理员选择的风格

func LoadAdminUIConfig

func LoadAdminUIConfig() (*systemconfigs.AdminUIConfig, error)

func LoadLogConfig

func LoadLogConfig() (*systemconfigs.LogConfig, error)

func LoadSecurityConfig

func LoadSecurityConfig() (*systemconfigs.SecurityConfig, error)

func NewSecurityConfig added in v1.3.5

func NewSecurityConfig() *systemconfigs.SecurityConfig

NewSecurityConfig create new security config

func NotifyAdminModuleMappingChange

func NotifyAdminModuleMappingChange() error

func ReloadAdminUIConfig added in v0.5.0

func ReloadAdminUIConfig() error

func ShowFinance

func ShowFinance() bool

ShowFinance 是否显示财务信息

func UpdateAdminLang added in v1.3.2

func UpdateAdminLang(adminId int64, langCode string)

UpdateAdminLang 修改某个管理员选择的语言

func UpdateAdminTheme added in v0.2.8

func UpdateAdminTheme(adminId int64, theme string)

UpdateAdminTheme 设置某个管理员的风格

func UpdateAdminUIConfig

func UpdateAdminUIConfig(uiConfig *systemconfigs.AdminUIConfig) error

func UpdateLogConfig

func UpdateLogConfig(logConfig *systemconfigs.LogConfig) error

func UpdateSecurityConfig

func UpdateSecurityConfig(securityConfig *systemconfigs.SecurityConfig) error

Types

type AdminModuleCode

type AdminModuleCode = string
const (
	AdminModuleCodeDashboard AdminModuleCode = "dashboard" // 看板
	AdminModuleCodeServer    AdminModuleCode = "server"    // 网站
	AdminModuleCodeNode      AdminModuleCode = "node"      // 节点
	AdminModuleCodeDNS       AdminModuleCode = "dns"       // DNS
	AdminModuleCodeNS        AdminModuleCode = "ns"        // 域名服务
	AdminModuleCodeAdmin     AdminModuleCode = "admin"     // 系统用户
	AdminModuleCodeUser      AdminModuleCode = "user"      // 平台用户
	AdminModuleCodeFinance   AdminModuleCode = "finance"   // 财务
	AdminModuleCodePlan      AdminModuleCode = "plan"      // 套餐
	AdminModuleCodeLog       AdminModuleCode = "log"       // 日志
	AdminModuleCodeSetting   AdminModuleCode = "setting"   // 设置
	AdminModuleCodeTicket    AdminModuleCode = "ticket"    // 工单
	AdminModuleCodeCommon    AdminModuleCode = "common"    // 只要登录就可以访问的模块
)

func FindFirstAdminModule

func FindFirstAdminModule(adminId int64) (module AdminModuleCode, ok bool)

FindFirstAdminModule 获取管理员第一个可访问模块

type AdminModuleList

type AdminModuleList struct {
	IsSuper  bool
	Modules  []*systemconfigs.AdminModule
	Fullname string
	Theme    string
	Lang     string
}

func (*AdminModuleList) Allow

func (this *AdminModuleList) Allow(module string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL