From c3b24826d1b782ea01767dce32702523d9163e2f Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 20 Mar 2019 17:33:45 +0100 Subject: Backport EE API parameters for API::Groups This backports the API parameters for API::Groups from EE to CE, ensuring both implementations use the same code. EE specific parameters are wrapped in an `if` statement for two reasons: 1. It allows us to completely disable the parameters in CE. 2. It removes the need for adding a source comment to signal that the parameters are EE only. --- lib/api/groups.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/api/groups.rb b/lib/api/groups.rb index cb0d6d96f29..9fcf476f537 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -20,8 +20,19 @@ module API optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group' end + if Gitlab.ee? + params :optional_params_ee do + optional :membership_lock, type: Boolean, desc: 'Prevent adding new members to project membership within this group' + optional :ldap_cn, type: String, desc: 'LDAP Common Name' + optional :ldap_access, type: Integer, desc: 'A valid access level' + optional :shared_runners_minutes_limit, type: Integer, desc: '(admin-only) Pipeline minutes quota for this group' + all_or_none_of :ldap_cn, :ldap_access + end + end + params :optional_params do use :optional_params_ce + use :optional_params_ee if Gitlab.ee? end params :statistics_params do @@ -164,6 +175,10 @@ module API optional :name, type: String, desc: 'The name of the group' optional :path, type: String, desc: 'The path of the group' use :optional_params + + if Gitlab.ee? + optional :file_template_project_id, type: Integer, desc: 'The ID of a project to use for custom templates in this group' + end end put ':id' do group = find_group!(params[:id]) -- cgit v1.2.1