Commit 96d557c4 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Hide HTTPS clone button for non-public projects for CAS users

Additionally, the prompt to set a password is no longer shown for CAS
users.
parent 15c49d9c
...@@ -410,11 +410,7 @@ module ProjectsHelper ...@@ -410,11 +410,7 @@ module ProjectsHelper
end end
def default_clone_protocol def default_clone_protocol
if allowed_protocols_present? extra_default_clone_protocol
enabled_protocol
else
extra_default_clone_protocol
end
end end
def extra_default_clone_protocol def extra_default_clone_protocol
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.git-clone-holder.js-git-clone-holder.input-group .git-clone-holder.js-git-clone-holder.input-group
.input-group-prepend .input-group-prepend
- if allowed_protocols_present? - if allowed_protocols_present? && project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?)
.input-group-text.clone-dropdown-btn.btn .input-group-text.clone-dropdown-btn.btn
%span.js-clone-dropdown-label %span.js-clone-dropdown-label
= enabled_project_button(project, enabled_protocol) = enabled_project_button(project, enabled_protocol)
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
%ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown %ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown
%li %li
= ssh_clone_button(project) = ssh_clone_button(project)
%li - if project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?)
= http_clone_button(project) %li
= http_clone_button(project)
= text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: 'Project clone URL' } = text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: 'Project clone URL' }
.input-group-append .input-group-append
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment