summaryrefslogtreecommitdiff
path: root/app/presenters/snippet_presenter.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-19 09:09:27 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-19 09:09:27 +0000
commit2af90cef2e2e9c776eae4394a43dba3be7f33d1e (patch)
treebb4bc691caa6cc74b45720ecd779517f9c8c2cd3 /app/presenters/snippet_presenter.rb
parentcf58004721ee715dd3884476f6fa0c62a7e7f247 (diff)
downloadgitlab-ce-2af90cef2e2e9c776eae4394a43dba3be7f33d1e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters/snippet_presenter.rb')
-rw-r--r--app/presenters/snippet_presenter.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/presenters/snippet_presenter.rb b/app/presenters/snippet_presenter.rb
index ba9d566932a..ba0b2b42383 100644
--- a/app/presenters/snippet_presenter.rb
+++ b/app/presenters/snippet_presenter.rb
@@ -11,6 +11,14 @@ class SnippetPresenter < Gitlab::View::Presenter::Delegated
Gitlab::UrlBuilder.build(snippet, raw: true)
end
+ def ssh_url_to_repo
+ snippet.ssh_url_to_repo if snippet.versioned_enabled_for?(current_user)
+ end
+
+ def http_url_to_repo
+ snippet.http_url_to_repo if snippet.versioned_enabled_for?(current_user)
+ end
+
def can_read_snippet?
can_access_resource?("read")
end