diff options
author | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2022-07-28 13:33:09 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2022-07-28 13:33:09 +0000 |
commit | 328ff31ff9e6147e4fb883aaee113001da150b9e (patch) | |
tree | e1c4c45aa86e7d3f3da88030b892764fff3bc0ff /app/controllers/autocomplete_controller.rb | |
parent | 4dc46d5b97305108c1b635baa4241a2ce04a7ed0 (diff) | |
parent | f415ebdb978c4eb976d07664219c788918120d59 (diff) | |
download | gitlab-ce-15-0-stable.tar.gz |
Merge remote-tracking branch 'dev/15-0-stable' into 15-0-stable15-0-stable
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r-- | app/controllers/autocomplete_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb index f84d2ed320d..22d7ccbd069 100644 --- a/app/controllers/autocomplete_controller.rb +++ b/app/controllers/autocomplete_controller.rb @@ -5,6 +5,7 @@ class AutocompleteController < ApplicationController skip_before_action :authenticate_user!, only: [:users, :award_emojis, :merge_request_target_branches] before_action :check_search_rate_limit!, only: [:users, :projects] + before_action :authorize_admin_project, only: :deploy_keys_with_owners feature_category :users, [:users, :user] feature_category :projects, [:projects] @@ -67,6 +68,10 @@ class AutocompleteController < ApplicationController private + def authorize_admin_project + render_403 unless Ability.allowed?(current_user, :admin_project, project) + end + def project @project ||= Autocomplete::ProjectFinder .new(current_user, params) |