Commit 891652c1 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'extract-ee-specific-code-from-application-controller' into 'master'

Extract EE code from ApplicationController

See merge request gitlab-org/gitlab-ee!8890
parents 12764071 372564b5
......@@ -151,10 +151,6 @@ class ApplicationController < ActionController::Base
end
end
def verify_namespace_plan_check_enabled
render_404 unless Gitlab::CurrentSettings.should_check_namespace_plan?
end
def log_exception(exception)
Gitlab::Sentry.track_acceptable_exception(exception)
......@@ -169,12 +165,8 @@ class ApplicationController < ActionController::Base
end
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
end
end
def can?(object, action, subject = :global)
Ability.allowed?(object, action, subject)
......@@ -497,3 +489,5 @@ class ApplicationController < ActionController::Base
Gitlab::Sentry.context(current_user)
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