2025-11-04 09:33:40 +08:00
|
|
|
|
---
|
|
|
|
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
|
|
|
|
--- Created by frankly.
|
|
|
|
|
|
--- DateTime: 2025/11/3 18:44
|
|
|
|
|
|
---
|
2025-11-04 21:57:42 +08:00
|
|
|
|
--[[
|
|
|
|
|
|
在"ngx_lua"模块的"init_by_lua_file"命令中执行;
|
|
|
|
|
|
只在启动nginx时初始化一次。
|
|
|
|
|
|
--]]
|
2025-11-04 09:33:40 +08:00
|
|
|
|
|
|
|
|
|
|
print("init application...")
|
2025-11-04 21:57:42 +08:00
|
|
|
|
--初始化,获取系统默认的用户权限,为实现RBAC框架做权限数据准备
|
2025-11-05 16:17:17 +08:00
|
|
|
|
local data = {
|
|
|
|
|
|
admin = {
|
|
|
|
|
|
"system:user:add", "system:user:edit", "system:user:delete", "system:user:view", "system:user:list"
|
|
|
|
|
|
},
|
|
|
|
|
|
guest = {
|
|
|
|
|
|
"system:user:view"
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
local dict = ngx.shared.dictRBAC
|
|
|
|
|
|
dict:set("users", data)
|