New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]casbin.NewEnforcer encountered Unforeseen results #689
Comments
Could you try |
@walterlife plz add the issue title. |
I use NewEnforcer,Is there any difference between the two |
@walterlife can you provide:
|
|
@walterlife any update? |
[request_definition]
r = sub, tenant, obj, act, group
[policy_definition]
p = sub, tenant, obj, act, eft, group
[role_definition]
g = _, _, _
[policy_effect]
e = some(where (p.eft == allow)) && !some(where (p.eft == deny))
[matchers]
m = (g(r.sub, p.sub, r.tenant) \
&& r.tenant == p.tenant \
&& (r.group == p.group || p.group == '*') \
&& keyMatch(r.obj, p.obj) \
&& regexMatch(r.act, p.act)) \
|| (r.sub == p.sub && p.tenant == '*' && p.obj == '*') \
|| (r.sub == p.sub && r.tenant == p.tenant && p.obj == '*') \
|| (r.sub == p.sub && r.tenant == p.tenant && p.obj == '*' && r.group == p.group) above is model config ok, errs := enforcer.Enforce(rule.V0, rule.V1, res.Resource, action, rule.V5) |
@closetool plz take a look. |
@walterlife may I have your policy file and source code |
Is it convenient to add WeChat? |
Can you just paste some piece of pivotal file here |
@walterlife plz provide model, policy, request and true + expected response, like this issue: #693 Better tested in: https://casbin.org/en/editor |
@closetool I think his log already contains the rules. We can roughly reproduce it for now.
|
@walterlife I can not make it happen again, so perhaps you used casbin in concurrency, and should use |
Closed as resolved. |
Hi, Team
First of all great library
I encountered a scenario, the same policy, the first check failed, and the check succeeded after 10ms. Have you encountered such a scenario?
Above is the problematic data
The text was updated successfully, but these errors were encountered: