diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /lib/api/helpers/performance_bar_helpers.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'lib/api/helpers/performance_bar_helpers.rb')
-rw-r--r-- | lib/api/helpers/performance_bar_helpers.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/helpers/performance_bar_helpers.rb b/lib/api/helpers/performance_bar_helpers.rb index 8430e889dff..0b7fb4308fc 100644 --- a/lib/api/helpers/performance_bar_helpers.rb +++ b/lib/api/helpers/performance_bar_helpers.rb @@ -4,17 +4,17 @@ module API module Helpers module PerformanceBarHelpers def set_peek_enabled_for_current_request - Gitlab::SafeRequestStore.fetch(:peek_enabled) { perf_bar_cookie_enabled? && perf_bar_enabled_for_user? } + Gitlab::SafeRequestStore.fetch(:peek_enabled) { perf_bar_cookie_enabled? && perf_bar_allowed_for_user? } end def perf_bar_cookie_enabled? cookies[:perf_bar_enabled] == 'true' end - def perf_bar_enabled_for_user? + def perf_bar_allowed_for_user? # We cannot use `current_user` here because that method raises an exception when the user # is unauthorized and some API endpoints require that `current_user` is not called. - Gitlab::PerformanceBar.enabled_for_user?(find_user_from_sources) + Gitlab::PerformanceBar.allowed_for_user?(find_user_from_sources) end end end |