Module: Impersonation

Includes:
Gitlab::Utils::StrongMemoize
Included in:
ApplicationController
Defined in:
app/controllers/concerns/impersonation.rb

Constant Summary collapse

SESSION_KEYS_TO_DELETE =
%w(
  github_access_token gitea_access_token gitlab_access_token
  bitbucket_token bitbucket_refresh_token bitbucket_server_personal_access_token
  bulk_import_gitlab_access_token fogbugz_token
).freeze

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#current_userObject


12
13
14
15
16
17
18
# File 'app/controllers/concerns/impersonation.rb', line 12

def current_user
  user = super

  user.impersonator = impersonator if impersonator

  user
end