diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 09:07:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 09:07:48 +0000 |
commit | 5bd24a54ef4ce3a38a860eb53b66d062c2382971 (patch) | |
tree | 5f5e65571dfcb2c62c27600ee7655dec4b44c923 /lib/api/keys.rb | |
parent | 74673d04d25ffed35cbcf17cd42969bed0a4e705 (diff) | |
download | gitlab-ce-5bd24a54ef4ce3a38a860eb53b66d062c2382971.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/keys.rb')
-rw-r--r-- | lib/api/keys.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/keys.rb b/lib/api/keys.rb index 8f2fd8cbae2..8f837107192 100644 --- a/lib/api/keys.rb +++ b/lib/api/keys.rb @@ -24,9 +24,11 @@ module API requires :fingerprint, type: String, desc: 'Search for a SSH fingerprint' end get do - authenticated_with_full_private_access! + authenticated_with_can_read_all_resources! - key = KeysFinder.new(current_user, params).execute + finder_params = params.merge(key_type: 'ssh') + + key = KeysFinder.new(current_user, finder_params).execute not_found!('Key') unless key present key, with: Entities::SSHKeyWithUser, current_user: current_user |