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

How to get user all permissions #482

Open
RogersLei opened this issue Aug 7, 2024 · 2 comments
Open

How to get user all permissions #482

RogersLei opened this issue Aug 7, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@RogersLei
Copy link

RogersLei commented Aug 7, 2024

Background
Node-casbin: 5.30.0

Want to get user permissions in resource with implicit use getImplicitResourcesForUser('alice') or getImplicitPermissionsForUser('alice') to get alice permissions in data2, but both are only return [[alice, data1, ALL, 15]]

Model

[request_definition]
r = sub, obj, attr, act

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

[role_definition]
g = _, _
g2 = _, _

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

[matchers]
m = g(r.sub, p.sub) && g2(r.obj, p.obj) && r.attr == p.attr && r.act == p.act

Policy

p, alice, data1, ALL, 15

g2, data1, data2
g2, data2, data1

Request
alice, data2, ALL, 15

Result
true

This example in editor is worked, but in code can't get permissions with data2.

Expected

[[alice, data1, ALL, 15], [alice, data2, ALL, 15]]
@casbin-bot
Copy link
Member

@nodece @Shivansh-yadav13

@casbin-bot casbin-bot added the enhancement New feature or request label Aug 7, 2024
@RogersLei
Copy link
Author

Hello, can anyone help ? Thanks!

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