node-casbin icon indicating copy to clipboard operation
node-casbin copied to clipboard

feat: Support for wildcard match

Open Shivansh-yadav13 opened this issue 3 years ago • 6 comments

  • Wildcard match can be used in the following for now

    • GetFilteredPolicy()
    • GetFilteredNamedPolicy()
    • GetFilteredGroupingPolicy()
    • GetFilteredNamedGroupingPolicy()
    • HasPolicy()
    • HasNamedPolicy()
    • HasGroupingPolicy()
    • HasNamedGroupingPolicy()
  • fix #358

Shivansh-yadav13 avatar Apr 16 '22 05:04 Shivansh-yadav13

@Gabriel-403 @Zxilly @kingiw @nodece please review

casbin-bot avatar Apr 16 '22 05:04 casbin-bot

@tangyang9464

hsluoyz avatar Apr 16 '22 07:04 hsluoyz

Is this synchronized with golang-casbin?

nodece avatar Apr 30 '22 08:04 nodece

Is this synchronized with golang-casbin?

@nodece I don't think we have this feature in golang-casbin

Shivansh-yadav13 avatar Apr 30 '22 08:04 Shivansh-yadav13

@Shivansh-yadav13 @nodece This pr supports wildcard match, but maybe still not flexible enough. For example, users may need to use different pattern match methods for different fields of the policy. Can we use matcher directly to filter policies? like casbin#1009. But it only supports GetFilteredPolicy. GetFilteredGroupingPolicy may be supported by this PR, but I don't think it is necessary to support it. As for HasPolicy, I don't think it's necessary to use wildcard match also.

tangyang9464 avatar May 12 '22 07:05 tangyang9464

@tangyang9464 then I'm adding GetFilteredNamedPolicyWithMatcher

Shivansh-yadav13 avatar May 16 '22 09:05 Shivansh-yadav13