diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-19 12:32:07 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-19 12:32:07 +0300 |
commit | 8adeda37b55fc992e3cb15422cae5d9646640630 (patch) | |
tree | 527587a80e6b1dde56b4aca1f02f89998b97c8e3 /lib | |
parent | c9edffcba6443d2bf72cfa6dda15fd53c106657b (diff) | |
parent | 6ad78d3ab1fc0ea9f344810e22b4fa7e8d67b6f7 (diff) |
Merge branch 'hanloong/gitlab-ce-remove-forks-from-projects-settings' into 'master'
Add ability to remove the fork relationship from project settings
![Screen_Shot_2015-10-18_at_12.37.24](/uploads/676571642a4c90f7f286280d714599a3/Screen_Shot_2015-10-18_at_12.37.24.png)
![Screen_Shot_2015-10-18_at_12.37.28](/uploads/1a069ecfc4cd3b5438772a9c3f04b6fc/Screen_Shot_2015-10-18_at_12.37.28.png)
Replaces !1579.
Fixes #2578.
See merge request !1636
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 4 |
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 |