summaryrefslogtreecommitdiff
path: root/app/views/projects/show.html.haml
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-14 06:07:12 -0700
committerStan Hu <stanhu@gmail.com>2018-10-15 10:18:04 -0700
commitc6ac04e4da60707a7bf13c796f95844e5409f451 (patch)
tree241b92c458a0bb1b34b4aa33ac4e9c80967cd849 /app/views/projects/show.html.haml
parent75b6ed8d2d0591efa19b02173c0524551e95f691 (diff)
downloadgitlab-ce-c6ac04e4da60707a7bf13c796f95844e5409f451.tar.gz
Fix commit signature error when project is disabled
When a project is disabled, visiting the home page would show, "An error occurred while loading commit signatures". This change checks that the user has permission to view the project to avoid unnecessary GPG signature lookups. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50903
Diffstat (limited to 'app/views/projects/show.html.haml')
-rw-r--r--app/views/projects/show.html.haml4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index aba289c790f..283031b06da 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -8,8 +8,8 @@
= render partial: 'flash_messages', locals: { project: @project }
-- if @project.repository_exists? && !@project.empty_repo?
- - signatures_path = namespace_project_signatures_path(namespace_id: @project.namespace.full_path, project_id: @project.path, id: @project.default_branch)
+- if !@project.empty_repo? && can?(current_user, :download_code, @project)
+ - signatures_path = project_signatures_path(@project, @project.default_branch)
.js-signature-container{ data: { 'signatures-path': signatures_path } }
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }