From 46dbfe77bcdf0d68fcd3e2c92e256f940dc7ce86 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 15 Jan 2024 23:41:13 -0500 Subject: [PATCH] fix: update def's --- api/casbin.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/casbin.go b/api/casbin.go index 5f387aa..e5d539b 100644 --- a/api/casbin.go +++ b/api/casbin.go @@ -13,8 +13,9 @@ func GetCasbin(logger *zap.Logger) *casbin.Enforcer { m := model.NewModel() m.AddDef("r", "r", "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("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)