diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/controllers/repositories/git_http_client_controller.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/controllers/repositories/git_http_client_controller.rb')
-rw-r--r-- | app/controllers/repositories/git_http_client_controller.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/repositories/git_http_client_controller.rb b/app/controllers/repositories/git_http_client_controller.rb index c002c9b83f9..24520a187e3 100644 --- a/app/controllers/repositories/git_http_client_controller.rb +++ b/app/controllers/repositories/git_http_client_controller.rb @@ -17,6 +17,9 @@ module Repositories prepend_before_action :authenticate_user, :parse_repo_path + skip_around_action :sessionless_bypass_admin_mode! + around_action :bypass_admin_mode!, if: :authenticated_user + feature_category :source_code_management def authenticated_user @@ -136,6 +139,12 @@ module Repositories container && Guest.can?(repo_type.guest_read_ability, container) end + + def bypass_admin_mode!(&block) + return yield unless Gitlab::CurrentSettings.admin_mode + + Gitlab::Auth::CurrentUserMode.bypass_session!(authenticated_user.id, &block) + end end end |