summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f5306801c04..60b5d9b6da8 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -33,6 +33,7 @@ class ApplicationController < ActionController::Base
before_action :check_impersonation_availability
before_action :required_signup_info
+ around_action :set_current_context
around_action :set_locale
around_action :set_session_storage
@@ -448,6 +449,14 @@ class ApplicationController < ActionController::Base
request.base_url
end
+ def set_current_context(&block)
+ Gitlab::ApplicationContext.with_context(
+ user: -> { auth_user },
+ project: -> { @project },
+ namespace: -> { @group },
+ &block)
+ end
+
def set_locale(&block)
Gitlab::I18n.with_user_locale(current_user, &block)
end