diff --git a/Gemfile b/Gemfile index f43a1b7d9..e4044ec18 100644 --- a/Gemfile +++ b/Gemfile @@ -63,6 +63,7 @@ gem "possessive" gem "auto_strip_attributes" # Use sidekiq for background processing gem "method_source", "~> 1.1" +gem "rack-mini-profiler", "~> 2.0" gem "rails_admin", "~> 3.1" gem "ruby-openai" gem "sidekiq" @@ -90,7 +91,6 @@ group :development do # Display performance information such as SQL time and flame graphs for each request in your browser. # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md gem "erb_lint", require: false - gem "rack-mini-profiler", "~> 2.0" gem "rubocop-govuk", "4.3.0", require: false gem "rubocop-performance", require: false gem "rubocop-rails", require: false diff --git a/app/controllers/lettings_logs_controller.rb b/app/controllers/lettings_logs_controller.rb index 491d92372..083a14a31 100644 --- a/app/controllers/lettings_logs_controller.rb +++ b/app/controllers/lettings_logs_controller.rb @@ -11,6 +11,11 @@ class LettingsLogsController < LogsController before_action :extract_bulk_upload_from_session_filters, only: [:index] before_action :redirect_if_bulk_upload_resolved, only: [:index] + before_action do + if current_user && current_user.support? + Rack::MiniProfiler.authorize_request + end + end def index all_logs = current_user.lettings_logs.visible.filter_by_years_or_nil(FormHandler.instance.years_of_available_lettings_forms)