-
Notifications
You must be signed in to change notification settings - Fork 371
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
Ignore prefix in middleware #64
Comments
It is a nice addition, but it must be done so that it keeps backwards compatibility, otherwise I will get a lot of emails from angry users :) |
I can think of a few options. We can add a new middleware method that wraps the old one, but exposes the new interface. We can add the new option to the end of the current function interface. How would you like to do it? |
I am happy with any of those approaches, take your pick :) |
@FreakTheMighty i think would work for you: https://github.com/futurechan/node_acl-mem-regexp It doesn't ignore prefixes, but I am able to block access to root resources and yet allow access to the subresource with regexes. *it uses the memory backend exclusively though |
@futurechan thanks for the reference. |
@FreakTheMighty if you don't mind, could you take a look at this and let me know what you think? https://github.com/futurechan/Connect-AccessControl |
I would like to add an option to the expressjs middleware to ignore a url prefix. This is useful if you are protecting resources that are beneath a namespace such as 'api/v1/posts/1'. In this case it makes sense to store the resource as 'posts/1' in the access control list rather than the full url.
For my own project I've made this change.
FreakTheMighty@6a6602e
I've also noted in my commit that I don't think the options should be passed as positional arguments as there are cases where you would want to specify some and not others. It looks like the contract module would need to be updated to support keyword arguments, is that correct?
The text was updated successfully, but these errors were encountered: