We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! Here's test code that demonstrates the issue:
[Fact] public void TestRbacModelInMemory2Objects() { string text = "[request_definition]\n" + "r = sub, obj, obj2, act\n" + "\n" + "[policy_definition]\n" + "p = sub, obj, obj2, act\n" + "\n" + "[role_definition]\n" + "g = _, _\n" + "\n" + "[policy_effect]\n" + "e = some(where (p.eft == allow))\n" + "\n" + "[matchers]\n" + "m = g(r.sub, p.sub) && r.obj == p.obj && r.obj2 == p.obj2 && r.act == p.act\n"; IModel m = DefaultModel.CreateFromText(text); Enforcer e = new(m); e.AddPermissionForUser("alice", "data1", "data10", "read"); e.AddPermissionForUser("data2_admin", "data1", "data10", "read"); e.AddRoleForUser("alice", "data2_admin"); TestEnforce(e, "alice", "data1", "data10", "read", true); TestEnforce(e, "alice", "data1", "data10", "write", false); }
P.S. Possible workaround is to rename definitions to be completely different (like 'abc' and 'xyz' instead of 'obj' and 'obj2')
The text was updated successfully, but these errors were encountered:
@sagilio @sociometry @AsakusaRinne
Sorry, something went wrong.
@dmolochnikov can you paste your error stack about the exception? Also can you try if the online editor has similar issue? https://casbin.org/editor
Thank you for the feedback, the reason is an error transform logic here when the value definitions are too similar. I will try to fix this later.
Casbin.NET/Casbin/EnforceView.cs
Lines 137 to 147 in 2d721e6
hsluoyz
Successfully merging a pull request may close this issue.
Hi!
Here's test code that demonstrates the issue:
P.S. Possible workaround is to rename definitions to be completely different (like 'abc' and 'xyz' instead of 'obj' and 'obj2')
The text was updated successfully, but these errors were encountered: