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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 21:07:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 21:07:55 +0300
commit5421d61b1d5ffe11a9c7afbe2259b4e4d0e7c993 (patch)
tree093cfd5a5f80119f6e9c7ccd2c646ca2482cc3d2 /lib/gitlab/auth
parentbc0f141f2f073a971aad1eb5349bb718747df028 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r--lib/gitlab/auth/current_user_mode.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/auth/current_user_mode.rb b/lib/gitlab/auth/current_user_mode.rb
index fc391543f4d..9bd4711c4bb 100644
--- a/lib/gitlab/auth/current_user_mode.rb
+++ b/lib/gitlab/auth/current_user_mode.rb
@@ -106,8 +106,8 @@ module Gitlab
end
def enable_admin_mode!(password: nil, skip_password_validation: false)
- return unless user&.admin?
- return unless skip_password_validation || user&.valid_password?(password)
+ return false unless user&.admin?
+ return false unless skip_password_validation || user&.valid_password?(password)
raise NotRequestedError unless admin_mode_requested?
@@ -115,6 +115,10 @@ module Gitlab
current_session_data[ADMIN_MODE_REQUESTED_TIME_KEY] = nil
current_session_data[ADMIN_MODE_START_TIME_KEY] = Time.now
+
+ audit_user_enable_admin_mode
+
+ true
end
def disable_admin_mode!
@@ -175,6 +179,10 @@ module Gitlab
def privileged_runtime?
Gitlab::Runtime.rake? || Gitlab::Runtime.rails_runner? || Gitlab::Runtime.console?
end
+
+ def audit_user_enable_admin_mode; end
end
end
end
+
+Gitlab::Auth::CurrentUserMode.prepend_mod_with('Gitlab::Auth::CurrentUserMode')