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 for the Wildcards in Resource names if it is a url for express #11

Open
zain-ul-abidin1 opened this issue May 18, 2022 · 2 comments

Comments

@zain-ul-abidin1
Copy link

Problem Statement

Hello, i am using this package and so far its going great, but a small thing is annoying me which is if i am using express url's as resource names in the acl allow rules then the wild cards are not supported e.g.

/api/users/login (resource 1)
/api/users/signup (resource 2)
/api/users/lremove (resource 3)

e.g. in config they would be written as

{
    "roles": [ "User" ],
    "allows": [
      { "resources": "/api/users/login", "permissions": [ "post", "put", "get", "delete" ] },
      { "resources": "/api/users/signup", "permissions": [ "post", "put", "get", "delete" ] },
      { "resources": "/api/users/remove", "permissions": [ "post", "put", "get", "delete" ] }
    ]
  }

Problem Solution Expected

now to allow these to user we have to define these separately instead of this i am expecting some thing like following in the config

{
    "roles": [ "User" ],
    "allows": [
      { "resources": "/api/users/*", "permissions": [ "post", "put", "get", "delete" ] }
    ]
  }
@koresar
Copy link

koresar commented May 18, 2022

That's something we would be happy to see! Feel free to implement.

@zain-ul-abidin1
Copy link
Author

Glad to hear from you, i shell definitely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants