diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-23 18:17:59 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-23 18:17:59 +0300 |
commit | 010790ee39069f82ced551db6a98f9234c5c81f7 (patch) | |
tree | 571b2cf65f9cc68cd797857c0a0bee200fbfef00 /lib | |
parent | ae4cc429a09d05a9bdfa7682bc6df9820786e2c1 (diff) | |
parent | eff1b05ab1d50895be668be12de8239def648d97 (diff) |
Merge branch 'api-delete-group-share' into 'master'
API: Add endpoint to delete a group share
Closes #24771
See merge request !7662
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 6b856128c2e..ddfde178d30 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -438,6 +438,19 @@ module API end end + params do + requires :group_id, type: Integer, desc: 'The ID of the group' + end + delete ":id/share/:group_id" do + authorize! :admin_project, user_project + + link = user_project.project_group_links.find_by(group_id: params[:group_id]) + not_found!('Group Link') unless link + + link.destroy + no_content! + end + # Upload a file # # Parameters: |