diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-12-27 18:00:49 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-12-27 18:00:49 +0300 |
commit | 20afb4c69ee91a91094eed2bffd566c5bca1ce0d (patch) | |
tree | 632bbb3e3e8978a8d7bb2e26dd91edf9b83ecd4d /app/helpers | |
parent | cdb29c2fb00a873e8f8f646b06c7b000cc13e610 (diff) | |
parent | c1d11bf57c3091aa4695e302e21c39b9ec723f54 (diff) |
Merge branch 'feature/1376-allow-write-access-deploy-keys' into 'master'
Allow to add deploy keys with write-access
Closes #1376
See merge request !7383
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/projects_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 0f17f6d8b7e..4b5a2dc8782 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -90,10 +90,12 @@ module ProjectsHelper end def project_for_deploy_key(deploy_key) - if deploy_key.projects.include?(@project) + if deploy_key.has_access_to?(@project) @project else - deploy_key.projects.find { |project| can?(current_user, :read_project, project) } + deploy_key.projects.find do |project| + can?(current_user, :read_project, project) + end end end |