Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

can? with additional parameters #48

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

can? with additional parameters #48

campbell opened this issue Mar 23, 2010 · 2 comments

Comments

@campbell
Copy link

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

@ryanb
Copy link
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.

@warmwind
Copy link

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

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants