Closed thoraj closed 2 years ago
@sagilio @xcaptain @huazhikui
You can try
enforcer,EnforceWithMatcher("g2(r.res, p.res, r.dom)", "", domain1, root1, "")
Any type of r/p/m/e is only supported on the v2.x/preview
branch, here is the sample:https://github.com/casbin/Casbin.NET/blob/b1f3b0bc7ba1f159ffe7d31542642080a191853a/NetCasbin.UnitTest/ModelTests/ModelTest.cs#L565-L605
Thanks for responding.
I was able to work around the issue, but will certainly try using the suggested ..enforce("matcher_exression")
I have the need to check if a value is part of a named grouping hierarchy.
Lets say I have:
What I would like to evaluate is:
Is there anything equivalent to
IsInGrouping()
in Casbin?My initial thought was to use a second matcher.
And use:
The idea is that this will work since the value provided for p.res argument when evaluating m2 would always come from a "p" policy. Unfortunately I ran into issues (#216) when testing this, hence the question if there is a more direct way to compute
IsInGrouping()
??