can? with additional parameters #48

Closed
campbell opened this Issue Mar 23, 2010 · 2 comments

Projects

None yet

3 participants

@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

Owner
ryanb commented Apr 15, 2010

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.

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment