about summary refs log tree commit diff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-22 22:59:54 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-22 22:59:54 +0100
commitfc90d38893ae81b83884c3f5c85d05d564f1de33 (patch)
tree8d881992a6afe8519277e6206c6289f574c00337 /app/controllers/application_controller.rb
parent4b5b953d4223776860bcccb56d2f9c7144dc302e (diff)
Moving some counter queries out of subqueries in the API
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 3a4c95db4..283f950cc 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,6 +14,7 @@ class ApplicationController < ActionController::Base
 
   before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
   before_action :set_locale
+  before_action :check_rack_mini_profiler
 
   def raise_not_found
     raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
@@ -31,6 +32,10 @@ class ApplicationController < ActionController::Base
     I18n.locale = I18n.default_locale
   end
 
+  def check_rack_mini_profiler
+    Rack::MiniProfiler.authorize_request if current_user && current_user.admin?
+  end
+
   protected
 
   def not_found