summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-03 12:22:44 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-03 12:28:47 +0200
commited097df62758880eb6412770f661266d4a6e9299 (patch)
tree488f682bac4c5c9762823a1055f85f9e5c88eca0 /app/helpers/projects_helper.rb
parenta243e44ca1ee57dc28ef72bd3521c17726ba5026 (diff)
downloadgitlab-ce-ed097df62758880eb6412770f661266d4a6e9299.tar.gz
Clean up code.
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index e3734023be3..ebbd2bfd77d 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -127,6 +127,14 @@ module ProjectsHelper
html + count_html
end
+ def project_for_deploy_key(deploy_key)
+ if deploy_key.projects.include?(@project)
+ @project
+ else
+ deploy_key.projects.find { |project| can?(current_user, :read_project, project) }
+ end
+ end
+
private
def get_project_nav_tabs(project, current_user)