Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /lib/api/projects.rb
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index fca68c3606b..19b63c28f89 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -136,6 +136,17 @@ module API
present records, options
end
+ def present_groups(groups)
+ options = {
+ with: Entities::PublicGroupDetails,
+ current_user: current_user
+ }
+
+ groups, options = with_custom_attributes(groups, options)
+
+ present paginate(groups), options
+ end
+
def translate_params_for_compatibility(params)
params[:builds_enabled] = params.delete(:jobs_enabled) if params.key?(:jobs_enabled)
params
@@ -561,6 +572,25 @@ module API
present paginate(users), with: Entities::UserBasic
end
+ desc 'Get ancestor and shared groups for a project' do
+ success Entities::PublicGroupDetails
+ end
+ params do
+ optional :search, type: String, desc: 'Return list of groups matching the search criteria'
+ optional :skip_groups, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Array of group ids to exclude from list'
+ optional :with_shared, type: Boolean, default: false,
+ desc: 'Include shared groups'
+ optional :shared_min_access_level, type: Integer, values: Gitlab::Access.all_values,
+ desc: 'Limit returned shared groups by minimum access level to the project'
+ use :pagination
+ end
+ get ':id/groups', feature_category: :source_code_management do
+ groups = ::Projects::GroupsFinder.new(project: user_project, current_user: current_user, params: declared_params(include_missing: false)).execute
+ groups = groups.search(params[:search]) if params[:search].present?
+
+ present_groups groups
+ end
+
desc 'Start the housekeeping task for a project' do
detail 'This feature was introduced in GitLab 9.0.'
end