Welcome to mirror list, hosted at ThFree Co, Russian Federation.

impersonations_controller.rb « admin « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1a6cb350ec8a7d03a2a81ac90dcf62f856e23cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class Admin::ImpersonationsController < Admin::ApplicationController
  skip_before_action :authenticate_admin!
  before_action :authenticate_impersonator!

  feature_category :user_management

  def destroy
    original_user = stop_impersonation
    redirect_to admin_user_path(original_user), status: :found
  end

  private

  def authenticate_impersonator!
    render_404 unless impersonator && impersonator.admin? && !impersonator.blocked?
  end
end