Module: Grape::CanCan::Endpoint
- Defined in:
- lib/grape/cancan.rb
Instance Method Summary collapse
-
#authorize_route! ⇒ Object
Call authorize using the :authorize key on the route.
-
#current_ability ⇒ Object
Returns an instance of the CanCan ability.
Instance Method Details
#authorize_route! ⇒ Object
Call authorize using the :authorize key on the route
23 24 25 26 |
# File 'lib/grape/cancan.rb', line 23 def opts = env['api.endpoint'].[:route_options] (*opts[:authorize]) if opts.key?(:authorize) end |
#current_ability ⇒ Object
Returns an instance of the CanCan ability
17 18 19 |
# File 'lib/grape/cancan.rb', line 17 def current_ability @current_ability ||= ::Ability.new(current_user) end |