configloaders

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecuritySettingName = "adminSecurityConfig"

	FrameNone       = ""
	FrameDeny       = "DENY"
	FrameSameOrigin = "SAMEORIGIN"
)
View Source
const (
	AdminUISettingName = "adminUIConfig"
)
View Source
const (
	LogSettingName = "adminLogConfig"
)
View Source
const (
	UserUISettingName = "userUIConfig"
)

Variables

This section is empty.

Functions

func AllModuleMaps

func AllModuleMaps() []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 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 LoadUserUIConfig

func LoadUserUIConfig() (*systemconfigs.UserUIConfig, error)

func NotifyAdminModuleMappingChange

func NotifyAdminModuleMappingChange() error

func ShowFinance

func ShowFinance() bool

是否显示财务信息

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

func UpdateUserUIConfig

func UpdateUserUIConfig(uiConfig *systemconfigs.UserUIConfig) 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"   // 财务
	AdminModuleCodeLog       AdminModuleCode = "log"       // 日志
	AdminModuleCodeSetting   AdminModuleCode = "setting"   // 设置
	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
}

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