可以根据管理界面设置/用户界面设置隐藏财务相关功能菜单

This commit is contained in:
刘祥超
2021-01-13 17:50:03 +08:00
parent dffc806fcc
commit 02fbc0de94
8 changed files with 36 additions and 3 deletions

View File

@@ -106,6 +106,7 @@ func (this *userMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramNam
action.Data["teaShowOpenSourceInfo"] = config.ShowOpenSourceInfo
action.Data["teaIsSuper"] = false
action.Data["teaDemoEnabled"] = teaconst.IsDemo
action.Data["teaShowFinance"] = configloaders.ShowFinance()
if !action.Data.Has("teaSubMenu") {
action.Data["teaSubMenu"] = ""
}
@@ -238,6 +239,10 @@ func (this *userMustAuth) modules(adminId int64) []maps.Map {
result := []maps.Map{}
for _, m := range allMaps {
if m.GetString("code") == "finance" && !configloaders.ShowFinance() {
continue
}
module := m.GetString("module")
if configloaders.AllowModule(adminId, module) {
result = append(result, m)