diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-29 13:02:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-29 13:02:17 +0000 |
commit | 6f10ecdeb6d8636ce7c9fb6cf7930f1a543f58df (patch) | |
tree | 959df42c10bab01d1bc81c87ea1ed8f9d3e4e98f /app/controllers/concerns | |
parent | 003d8b5eac3aa173a7061b82d84ffaf28e8024f6 (diff) | |
download | gitlab-ce-6f10ecdeb6d8636ce7c9fb6cf7930f1a543f58df.tar.gz |
Add latest changes from gitlab-org/security/gitlab@14-3-stable-ee
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/impersonation.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/concerns/impersonation.rb b/app/controllers/concerns/impersonation.rb index a8788e7f8bd..539dd9ad69d 100644 --- a/app/controllers/concerns/impersonation.rb +++ b/app/controllers/concerns/impersonation.rb @@ -20,7 +20,7 @@ module Impersonation protected def check_impersonation_availability - return unless session[:impersonator_id] + return unless impersonation_in_progress? unless Gitlab.config.gitlab.impersonation_enabled stop_impersonation @@ -38,6 +38,10 @@ module Impersonation current_user end + def impersonation_in_progress? + session[:impersonator_id].present? + end + def log_impersonation_event Gitlab::AppLogger.info("User #{impersonator.username} has stopped impersonating #{current_user.username}") end |