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.
This commit is contained in:
parent
a5c54bac44
commit
c3b24826d1
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue