Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

can? with additional parameters #48

Closed
campbell opened this Issue · 2 comments

3 participants

Pete Campbell Ryan Bates JIANG Peng
Pete Campbell

I'm wondering why we cannot (or should not) pass in additional parameters to can?, eg
can? :manage, result, arbitrary_parameter1, arbitrary_parameter2

can :manage, Result do |action, result, arb_param1, arb_param2|
  arb_param1 == 'blue' || arb_param2 == 42
end

This seems like a more flexible version of Accessing Request Data because the arbitrary parameters don't have to be included in the ApplicationController code.

Gist example of CAN? with arbitrary parameters

Ryan Bates
Owner

That's a good suggestion, and considering the number of votes I can see others are interested in seeing this. I'll work on bringing this behavior in.

JIANG Peng

Have this feature implemented? I need exactly the same functionality.

Robin Wenglewski rweng referenced this issue from a commit in arcanio/cancan
Paul Alexander phallguy Cleaning up for @bryanrite #48 11dae7c
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.