This commit is contained in:
❀ » Cato Sweeney. ❀ » Console@the.bb
2025-12-03 14:37:32 +08:00
parent e9e409d958
commit 560bde5b44
3 changed files with 12 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ postgresql:
max-open-conns: 10
casbin:
model-path: "./resource/rbac_model.conf"
model-path: "./rbac_model.conf"
gen:
# 代码生成读取的数据库名称

11
res/rbac_model.conf Normal file
View File

@@ -0,0 +1,11 @@
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = r.sub == p.sub && (keyMatch2(r.obj, p.obj) || keyMatch(r.obj, p.obj)) && ( r.act == p.act || p.act == '*')