Closed will7200 closed 4 years ago
@nodece please take a look.
@will7200 I tried to clone by gh repo clone casbin/jcasbin
, then use the data you provide for testing, jcasbin works fine.
[main] INFO org.casbin.jcasbin - Model:
[main] INFO org.casbin.jcasbin - p.p: sub, dom, obj, act, eft
[main] INFO org.casbin.jcasbin - r.r: sub, dom, obj, act
[main] INFO org.casbin.jcasbin - e.e: priority(p_eft) || deny
[main] INFO org.casbin.jcasbin - g.g: _, _, _
[main] INFO org.casbin.jcasbin - m.m: (((r_sub == p_sub) || g(r_sub, p_sub, r_dom)) && r_dom == p_dom && c(r_obj, p_obj) && regexMatch(r_act, p_act)) || (g(r_sub, "root", p_dom) || r_sub == "admin")
[main] INFO org.casbin.jcasbin - Policy:
[main] INFO org.casbin.jcasbin - p: sub, dom, obj, act, eft: [[alice, domain1, /foo/bar/.+/.+baz.+, GET, allow], [alice, domain1, /foo/bar/.+/baz$, GET, deny], [alice, domain1, /foo/bar/.+, GET, allow], [alice, domain1, /foo/bar.+, GET, deny], [alice, domain1, /foo/bar$, GET, allow], [alice, 10.10.10.10, /foo/.+, GET, allow], [alice, 10.10.10.10, /foo.+, GET, deny], [alice, domain1, /foo/.+, GET, deny], [alice, domain1, /foo.+, GET, deny], [data2_admin, domain1, /foo$, GET, allow], [alice, domain1, /foo$, GET, deny], [root, domain1, /foo$, GET, deny], [alice, domain1, /.+, GET, deny]]
[main] INFO org.casbin.jcasbin - g: _, _, _: [[alice, data2_admin, domain1], [bob, root, domain1]]
[main] INFO org.casbin.jcasbin - Role links for: g
[main] INFO org.casbin.jcasbin - bob < root
[main] INFO org.casbin.jcasbin - root <
[main] INFO org.casbin.jcasbin - alice < data2_admin
[main] INFO org.casbin.jcasbin - data2_admin <
[main] INFO org.casbin.jcasbin - Request: bob, domain1, /foo, POST ---> true
[main] INFO org.casbin.jcasbin - Request: bob, domain1, /foo$, GET ---> true
[main] INFO org.casbin.jcasbin - Request: bob, domain1, /foo/bar/baz, GET ---> true
[main] INFO org.casbin.jcasbin - Request: bob, domain2, /foo, PUT ---> true
[main] INFO org.casbin.jcasbin - Request: bob, domain2, /foo, GET ---> true
@nodece Thanks for looking into this. It seems that I am getting the correct results now. I was able to replicate the issue yesterday, but now I can no longer today. Most likely a bug in the plugin then.
Hello
A user of the casbin plugin for Jetbrains is experiencing some mismatched results compared to the online editor. The following is the policy, model, test request with results from java implementation vs online implementation. You can refer to the original issue will7200/casbin-idea-plugin#2. Any help would be appreciated.
Casbin policy:
Casbin model:
Test requests