From 48aff82709769b098321c738f3444b9bdaa694c6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Oct 2020 07:08:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-5-stable-ee --- lib/api/groups.rb | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/api/groups.rb') diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 813e41b4d39..bf3d6c3c7e0 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module API - class Groups < Grape::API::Instance + class Groups < ::API::Base include PaginationParams include Helpers::CustomAttributes @@ -29,7 +29,12 @@ module API # rubocop: disable CodeReuse/ActiveRecord def find_groups(params, parent_id = nil) - find_params = params.slice(:all_available, :custom_attributes, :owned, :min_access_level) + find_params = params.slice( + :all_available, + :custom_attributes, + :owned, :min_access_level, + :include_parent_descendants + ) find_params[:parent] = if params[:top_level_only] [nil] @@ -309,6 +314,19 @@ module API present_groups params, groups end + desc 'Get a list of descendant groups of this group.' do + success Entities::Group + end + params do + use :group_list_params + use :with_custom_attributes + end + get ":id/descendant_groups" do + finder_params = declared_params(include_missing: false).merge(include_parent_descendants: true) + groups = find_groups(finder_params, params[:id]) + present_groups params, groups + end + desc 'Transfer a project to the group namespace. Available only for admin.' do success Entities::GroupDetail end -- cgit v1.2.1