summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-21 10:24:06 +0200
committerDouwe Maan <douwe@gitlab.com>2015-10-21 10:24:06 +0200
commitd37cf6423759e445f0bff5121eb1ed1467ae0fd1 (patch)
treea82936658ac1058e96d535af7ef17ca0eb5bf790 /lib/api/projects.rb
parentd9944fdb59fe286022130f133f316b80dec04ea6 (diff)
parent35618a3dfffe546744123bcaf560ba9f74c42eef (diff)
downloadgitlab-ce-d37cf6423759e445f0bff5121eb1ed1467ae0fd1.tar.gz
Merge branch 'master' into hanloong/gitlab-ce-add-dates-snippets-show
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index c2fb36b4143..67ee66a2058 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -246,8 +246,8 @@ module API
# Example Request:
# DELETE /projects/:id/fork
delete ":id/fork" do
- authenticated_as_admin!
- unless user_project.forked_project_link.nil?
+ authorize! :remove_fork_project, user_project
+ if user_project.forked?
user_project.forked_project_link.destroy
end
end