Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct "return cant jump across threads" error when using check_auth…

…orization()
  • Loading branch information...
commit b3fc5add347a613009035e1f2376080328732b51 1 parent 610d7e3
@codeprimate codeprimate authored committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/cancan/controller_additions.rb
View
6 lib/cancan/controller_additions.rb
@@ -247,9 +247,9 @@ def skip_authorize_resource(*args)
#
def check_authorization(options = {})
self.after_filter(options.slice(:only, :except)) do |controller|
- return if controller.instance_variable_defined?(:@_authorized)
- return if options[:if] && !controller.send(options[:if])
- return if options[:unless] && controller.send(options[:unless])
+ next if controller.instance_variable_defined?(:@_authorized)
+ next if options[:if] && !controller.send(options[:if])
+ next if options[:unless] && controller.send(options[:unless])
raise AuthorizationNotPerformed, "This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check."
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.