node-casbin
node-casbin copied to clipboard
Support WildCard Match in getFilteredPolicy
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;
}
@Gabriel-403 @Zxilly @kingiw @nodece
@Shivansh-yadav13
working on it.
@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?
@kerituni12 please review #361
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
The g
type policy uses wildcard for users under normal_group
. But I cannot get it supported by node-casbin...
@tangramor what you said is a different problem. Please create a new issue