lib/pragma/operation/authorization.rb in pragma-operation-1.2.0 vs lib/pragma/operation/authorization.rb in pragma-operation-1.2.1
- old
+ new
@@ -67,9 +67,14 @@
authorizable
else
build_policy(authorizable)
end
+ params.each_pair do |name, value|
+ next unless policy.resource.respond_to?("#{name}=")
+ policy.resource.send("#{name}=", value)
+ end
+
policy.send("#{self.class.operation_name}?")
end
# Authorizes this operation on the provided resource or policy. If the user is not
# authorized to perform the operation, responds with 403 Forbidden and an error body and