-
Notifications
You must be signed in to change notification settings - Fork 27
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
passing optional params to can? #11
Comments
The |
I tend to favour @OvermindDL1's solution here. |
@OvermindDL1 Yeah but pattern matching on keyword looks ugly, to make the point I skip the reality :) hmm, as your solution I understand that it's possible to wrap it around but if you use it in |
Hey,
So I have this setup:
GroupController
=>/groups/:group_id
UserController
=>/groups/:group_id/users
AppController
=>/groups/:group_id/apps
I want to allow only admins access to
users
:This works well I use it with Canary so I add this plug to my
UserController
Now if I want to limit access to
AppController
to only the users that belongs to that group,I can add same plug to
AppController
:And I need to add a new
can?
to implemention:But As you can see the new
can?
has the same pattern as previous function.What do you think if we add another optional param to to can?
Then I can use it like this:
I know that you are quite busy, let me know what do you think and if you agree with the change I will create PR.
The text was updated successfully, but these errors were encountered: