summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-02-12 03:58:16 +0000
committerRobert Speicher <robert@gitlab.com>2016-02-12 03:58:16 +0000
commitdd4171eb63e947bb5bdd57aa57242557aac1e963 (patch)
tree485f7b00ff868ef6d1adc47744d9853837030a60
parent67fefe0ed93b4c5b78c09d50020e6c8c593335be (diff)
parent4d1e82e0bb443e9f1adc8c6c27925fb50f12578b (diff)
downloadgitlab-ce-dd4171eb63e947bb5bdd57aa57242557aac1e963.tar.gz
Merge branch 'issue_13369' into 'master'
Don't show fork button if user can't fork the project. Fixes #13369 See merge request !2793
-rw-r--r--app/views/projects/forks/index.html.haml17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml
index c834bf63b28..42fa6fdb782 100644
--- a/app/views/projects/forks/index.html.haml
+++ b/app/views/projects/forks/index.html.haml
@@ -29,14 +29,15 @@
= link_to page_filter_path(sort: sort_value_oldest_updated, without: excluded_filters) do
= sort_title_oldest_updated
- - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
- = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-new' do
- = icon('code-fork fw')
- Fork
- - else
- = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-new' do
- = icon('code-fork fw')
- Fork
+ - if current_user && can?(current_user, :fork_project, @project)
+ - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
+ = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-new' do
+ = icon('code-fork fw')
+ Fork
+ - else
+ = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-new' do
+ = icon('code-fork fw')
+ Fork
.projects-list-holder