From b961f5536b78d6b6a2937c6deefeced621ff2b6c Mon Sep 17 00:00:00 2001 From: Daniel Gerhardt Date: Wed, 26 Aug 2015 11:34:42 +0200 Subject: [PATCH] Always check visibility on correct project for clone panel The project variable can hold an object which is not an instance of Project (e.g. ProjectWiki). In this case, visibility_level is not defined. --- app/views/shared/_clone_panel.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index 9e2b4d8adc3..6bb2438c577 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -2,7 +2,7 @@ .git-clone-holder.js-git-clone-holder.input-group .input-group-prepend - - if allowed_protocols_present? && project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?) + - if allowed_protocols_present? && @project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?) .input-group-text.clone-dropdown-btn.btn %span.js-clone-dropdown-label = enabled_project_button(project, enabled_protocol) @@ -14,7 +14,7 @@ %ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown %li = ssh_clone_button(project) - - if project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?) + - if @project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?) %li = http_clone_button(project) = render_if_exists 'shared/kerberos_clone_button', project: project -- GitLab