Correct "return cant jump across threads" error when using check_authorization()
This commit is contained in:
parent
610d7e3ec4
commit
b3fc5add34
|
@ -247,9 +247,9 @@ module CanCan
|
||||||
#
|
#
|
||||||
def check_authorization(options = {})
|
def check_authorization(options = {})
|
||||||
self.after_filter(options.slice(:only, :except)) do |controller|
|
self.after_filter(options.slice(:only, :except)) do |controller|
|
||||||
return if controller.instance_variable_defined?(:@_authorized)
|
next if controller.instance_variable_defined?(:@_authorized)
|
||||||
return if options[:if] && !controller.send(options[:if])
|
next if options[:if] && !controller.send(options[:if])
|
||||||
return if options[:unless] && controller.send(options[:unless])
|
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."
|
raise AuthorizationNotPerformed, "This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user