Skip to content

Commit

Permalink
Update fetches_things.rb to use custom policy if available
Browse files Browse the repository at this point in the history
  • Loading branch information
ddmck authored Sep 28, 2023
1 parent 3ada139 commit 8775782
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/avo/concerns/fetches_things.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_model_class_by_name(name)
def get_available_resources(user = nil)
valid_resources
.select do |resource|
Services::AuthorizationService.authorize user, resource.model_class, Avo.configuration.authorization_methods.stringify_keys["index"], raise_exception: false
Services::AuthorizationService.authorize user, resource.model_class, Avo.configuration.authorization_methods.stringify_keys["index"], policy_class: resource.authorization_policy ,raise_exception: false
end
.sort_by { |r| r.name }
end
Expand Down

0 comments on commit 8775782

Please sign in to comment.