mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Render only displayed report options
This commit is contained in:
@@ -309,10 +309,8 @@ Spree::Admin::ReportsController.class_eval do
|
||||
:xero_invoices,
|
||||
:packing
|
||||
]
|
||||
reports = all_reports.map { |report| [report, describe_report(report)] }.to_h
|
||||
|
||||
# Return only reports the user is authorized to view.
|
||||
reports.select { |action| can? action, :report }
|
||||
reports = all_reports.select { |action| can? action, :report }
|
||||
reports.map { |report| [report, describe_report(report)] }.to_h
|
||||
end
|
||||
|
||||
def describe_report(report)
|
||||
|
||||
Reference in New Issue
Block a user