Class: ActionController::Metal
- Inherits:
-
Object
- Object
- ActionController::Metal
- Defined in:
- lib/authorizer/action_controller_patch.rb
Instance Method Summary collapse
Instance Method Details
#check_authorization(resource, authorizee, **options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/authorizer/action_controller_patch.rb', line 7 def (resource, , **) action = "#{params[:controller]}##{action_name}" if resource.respond_to?(:length) return resource if resource.length == 0 r = Resource.new(action, , *resource, **) result = r.get else result = resource.(action, ) end result end |