Skip to content
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

[Bug] Policy definition contains 2 different policy sets (p and p2) doesn't work in Casbin editor #472

Open
taksedo opened this issue Mar 28, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@taksedo
Copy link

taksedo commented Mar 28, 2024

Want to prioritize this issue? Try:

issuehunt-to-marktext


Describe the bug
The case from the doc with to types of policies (p and p2) doesn't work on https://editor.casbin.org.

Link to the case: https://editor.casbin.org/#2YLC95Q57

To Reproduce
Establish following Model:

[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act
p2 = sub, act

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act

and Policy:

p, alice, data1, read
p2, bob, write-all-objects

Requests:

alice, data1, read
bob, data1, write-all-objects

Expected behavior
all requests should return true, but 2nd request returns false

Screenshots
image

@taksedo taksedo added the bug Something isn't working label Mar 28, 2024
@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang

@hsluoyz hsluoyz changed the title [Bug] Policy definition contains 2 different policy sets (p and p2) doesn't work [Bug] Policy definition contains 2 different policy sets (p and p2) doesn't work in Casbin editor Mar 31, 2024
@hsluoyz
Copy link
Member

hsluoyz commented Mar 31, 2024

@taksedo the Casbin editor is based on Node.js version Casbin, which currently doesn't support p2 yet. This Go Casbin supports it.

@taksedo
Copy link
Author

taksedo commented Apr 1, 2024

Thank you!

@taksedo taksedo closed this as completed Apr 1, 2024
@hsluoyz hsluoyz reopened this Apr 1, 2024
@casbin-bot
Copy link
Member

@nodece @Shivansh-yadav13

@hsluoyz hsluoyz added enhancement New feature or request and removed bug Something isn't working labels Apr 1, 2024
@hsluoyz hsluoyz transferred this issue from casbin/casbin Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants