Skip to content

Commit

Permalink
Correct "return cant jump across threads" error when using check_auth…
Browse files Browse the repository at this point in the history
…orization()
  • Loading branch information
Patrick Morgan authored and ryanb committed Sep 28, 2011
1 parent 610d7e3 commit b3fc5ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cancan/controller_additions.rb
Expand Up @@ -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
Expand Down

0 comments on commit b3fc5ad

Please sign in to comment.