lib/pragma/operation/authorization.rb in pragma-operation-1.2.2 vs lib/pragma/operation/authorization.rb in pragma-operation-1.2.3
- old
+ new
@@ -61,10 +61,10 @@
#
# @return [Boolean] whether the operation is authorized
def authorize(authorizable)
return true unless self.class.policy_klass
- policy = if authorizable.is_a?(self.class.policy_klass)
+ policy = if self.class.policy_klass && authorizable.is_a?(self.class.policy_klass)
authorizable
else
build_policy(authorizable)
end