Skip to content

Commit

Permalink
Update lib/avo/concerns/fetches_things.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Oct 9, 2023
1 parent 8775782 commit ec6bc71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/avo/concerns/fetches_things.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ 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"], policy_class: resource.authorization_policy ,raise_exception: false
resource.authorization.class.authorize(
user,
resource.model_class,
Avo.configuration.authorization_methods.stringify_keys["index"],
raise_exception: false
)
end
.sort_by { |r| r.name }
end
Expand Down

0 comments on commit ec6bc71

Please sign in to comment.