From f5585191e9de3bc8e1b61ad366104cbc33194b77 Mon Sep 17 00:00:00 2001 From: AreejNour Date: Tue, 23 Apr 2024 10:29:49 +0200 Subject: [PATCH] fix access denied error when using search filter --- lib/active_admin/resource_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_admin/resource_controller.rb b/lib/active_admin/resource_controller.rb index 30718fcf7b2..35abf932394 100644 --- a/lib/active_admin/resource_controller.rb +++ b/lib/active_admin/resource_controller.rb @@ -57,7 +57,7 @@ def restrict_format_access! unless request.format.html? presenter = active_admin_config.get_page_presenter(:index) download_formats = (presenter || {}).fetch(:download_links, active_admin_config.namespace.download_links) - unless build_download_formats(download_formats).include?(request.format.symbol) + if !build_download_formats(download_formats).include?(request.format.symbol) && !(request.format.symbol == :json && CGI.parse(request.query_string).key?('q[combinator]')) raise ActiveAdmin::AccessDenied.new(current_active_admin_user, :index) end end