Commit 372564b5 authored by Rémy Coutable's avatar Rémy Coutable

Extract EE code from ApplicationController

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent e515725c
...@@ -151,10 +151,6 @@ class ApplicationController < ActionController::Base ...@@ -151,10 +151,6 @@ class ApplicationController < ActionController::Base
end end
end end
def verify_namespace_plan_check_enabled
render_404 unless Gitlab::CurrentSettings.should_check_namespace_plan?
end
def log_exception(exception) def log_exception(exception)
Gitlab::Sentry.track_acceptable_exception(exception) Gitlab::Sentry.track_acceptable_exception(exception)
...@@ -169,12 +165,8 @@ class ApplicationController < ActionController::Base ...@@ -169,12 +165,8 @@ class ApplicationController < ActionController::Base
end end
def after_sign_out_path_for(resource) def after_sign_out_path_for(resource)
if Gitlab::Geo.secondary?
Gitlab::Geo.primary_node.oauth_logout_url(@geo_logout_state)
else
Gitlab::CurrentSettings.after_sign_out_path.presence || new_user_session_path Gitlab::CurrentSettings.after_sign_out_path.presence || new_user_session_path
end end
end
def can?(object, action, subject = :global) def can?(object, action, subject = :global)
Ability.allowed?(object, action, subject) Ability.allowed?(object, action, subject)
...@@ -497,3 +489,5 @@ class ApplicationController < ActionController::Base ...@@ -497,3 +489,5 @@ class ApplicationController < ActionController::Base
Gitlab::Sentry.context(current_user) Gitlab::Sentry.context(current_user)
end end
end end
ApplicationController.prepend(EE::ApplicationController)
# frozen_string_literal: true
module EE
module ApplicationController
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
def verify_namespace_plan_check_enabled
render_404 unless ::Gitlab::CurrentSettings.should_check_namespace_plan?
end
override :after_sign_out_path_for
def after_sign_out_path_for(resource)
if ::Gitlab::Geo.secondary?
::Gitlab::Geo.primary_node.oauth_logout_url(@geo_logout_state) # rubocop:disable Gitlab/ModuleWithInstanceVariables
else
super
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment