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

Support WildCard Match in getFilteredPolicy #358

Open
kerituni12 opened this issue Apr 14, 2022 · 7 comments
Open

Support WildCard Match in getFilteredPolicy #358

kerituni12 opened this issue Apr 14, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@kerituni12
Copy link

Example :
I have subject admin:create:any , admin:create:own, i need wildcard to get matched subject and then check value is any or own to handle my business logic

getFilteredPolicy(0, 'admin:create:*', 'user', 'create')

I think the getFilteredPolicy() support something like

 if (fieldValue !== '' && rule[fieldIndex + i] !== fieldValue && !picomatch.isMatch(rule[fieldIndex + i], fieldValue)) {
          matched = false;
          break;
 }
@casbin-bot
Copy link
Member

@casbin-bot casbin-bot added the enhancement New feature or request label Apr 14, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Apr 14, 2022

@Shivansh-yadav13

@Shivansh-yadav13
Copy link
Member

working on it.

@Shivansh-yadav13
Copy link
Member

@hsluoyz maybe we can create a method so that wildcard support can be added for all such types of methods. should we focus on adding something like that?

Shivansh-yadav13 added a commit to Shivansh-yadav13/node-casbin that referenced this issue Apr 16, 2022
@Shivansh-yadav13
Copy link
Member

@kerituni12 please review #361

@tangramor
Copy link

I am using casdoor with node-casbin, and after I created a permission with role (no user added), I got following policy in casbin_rule table

image

The g type policy uses wildcard for users under normal_group. But I cannot get it supported by node-casbin...

@hsluoyz
Copy link
Member

hsluoyz commented Apr 21, 2023

@tangramor what you said is a different problem. Please create a new issue

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

Successfully merging a pull request may close this issue.

5 participants