fix: update def's

This commit is contained in:
Derrick Hammer 2024-01-15 23:41:13 -05:00
parent e40111a276
commit 46dbfe77bc
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -13,8 +13,9 @@ func GetCasbin(logger *zap.Logger) *casbin.Enforcer {
m := model.NewModel() m := model.NewModel()
m.AddDef("r", "r", "sub, obj, act") m.AddDef("r", "r", "sub, obj, act")
m.AddDef("p", "p", "sub, obj, act") m.AddDef("p", "p", "sub, obj, act")
m.AddDef("g", "g", "_, _")
m.AddDef("e", "e", "some(where (p.eft == allow))") m.AddDef("e", "e", "some(where (p.eft == allow))")
m.AddDef("m", "m", "r.sub == p.sub && keyMatch2(r.obj, p.obj) && r.act == p.act") m.AddDef("m", "m", "g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act")
a := NewPolicyAdapter(logger) a := NewPolicyAdapter(logger)