CE-port of Refactor EE specific params override in API::Groups

This commit is contained in:
Imre Farkas 2019-05-27 12:37:53 +00:00 committed by Lin Jen-Shin
parent 2d980fadb8
commit a5488e452e
2 changed files with 25 additions and 26 deletions

View File

@ -7,34 +7,9 @@ module API
before { authenticate_non_get! }
helpers do
params :optional_params_ce do
optional :description, type: String, desc: 'The description of the group'
optional :visibility, type: String,
values: Gitlab::VisibilityLevel.string_values,
default: Gitlab::VisibilityLevel.string_level(
Gitlab::CurrentSettings.current_application_settings.default_group_visibility),
desc: 'The visibility of the group'
optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group'
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group'
end
params :optional_params_ee do
end
params :optional_update_params_ee do
end
end
include ::API::Helpers::GroupsHelpers
helpers Helpers::GroupsHelpers
helpers do
params :optional_params do
use :optional_params_ce
use :optional_params_ee
end
params :statistics_params do
optional :statistics, type: Boolean, default: false, desc: 'Include project statistics'
end

View File

@ -4,6 +4,30 @@ module API
module Helpers
module GroupsHelpers
extend ActiveSupport::Concern
extend Grape::API::Helpers
params :optional_params_ce do
optional :description, type: String, desc: 'The description of the group'
optional :visibility, type: String,
values: Gitlab::VisibilityLevel.string_values,
default: Gitlab::VisibilityLevel.string_level(
Gitlab::CurrentSettings.current_application_settings.default_group_visibility),
desc: 'The visibility of the group'
optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group'
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group'
end
params :optional_params_ee do
end
params :optional_update_params_ee do
end
params :optional_params do
use :optional_params_ce
use :optional_params_ee
end
end
end
end