Skip to content

Commit

Permalink
Revert "Remove preemptive allow filter override"
Browse files Browse the repository at this point in the history
This reverts commit 7dd73e1.
Because we want a lasting solution, working for all users.
  • Loading branch information
Kagemaru committed Sep 12, 2023
1 parent a7c86fe commit ba23e90
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/overrides/assemblies/admin/assemblies_controller_override.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

Decidim::Assemblies::Admin::AssembliesController.class_eval do
def filtered_collection
valid_ids =
query
.result
.select { |a| allowed_to? :list, :assembly, assembly: a }
.map(&:id)

assemblies = query.result.where(id: valid_ids)

paginate(assemblies)
end
end

0 comments on commit ba23e90

Please sign in to comment.