diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-05-28 10:14:26 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-05-28 10:14:26 +0000 |
commit | 3895e547415cf502ff6eafc18e98f245a058afcd (patch) | |
tree | 06ddf4ea7d3bda4505b7445be19c5b94abf7ec61 /lib | |
parent | 9c2d0d87581f34567e33de1b384f1f360edcd4b7 (diff) | |
download | gitlab-ce-3895e547415cf502ff6eafc18e98f245a058afcd.tar.gz |
CE port of Move EE specific lines in API::Users
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers/users_helpers.rb | 16 | ||||
-rw-r--r-- | lib/api/users.rb | 12 |
2 files changed, 20 insertions, 8 deletions
diff --git a/lib/api/helpers/users_helpers.rb b/lib/api/helpers/users_helpers.rb new file mode 100644 index 00000000000..56fd3c6602d --- /dev/null +++ b/lib/api/helpers/users_helpers.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module API + module Helpers + module UsersHelpers + extend ActiveSupport::Concern + extend Grape::API::Helpers + + params :optional_params_ee do + end + + params :optional_index_params_ee do + end + end + end +end diff --git a/lib/api/users.rb b/lib/api/users.rb index 2f23e33bd4a..6afeebb6890 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -15,6 +15,8 @@ module API authenticate_non_get! end + helpers Helpers::UsersHelpers + helpers do # rubocop: disable CodeReuse/ActiveRecord def find_user_by_id(params) @@ -52,10 +54,7 @@ module API optional :private_profile, type: Boolean, desc: 'Flag indicating the user has a private profile' all_or_none_of :extern_uid, :provider - if Gitlab.ee? - optional :shared_runners_minutes_limit, type: Integer, desc: 'Pipeline minutes quota for this user' - optional :extra_shared_runners_minutes_limit, type: Integer, desc: '(admin-only) Extra pipeline minutes quota for this user' - end + use :optional_params_ee end params :sort_params do @@ -85,10 +84,7 @@ module API use :sort_params use :pagination use :with_custom_attributes - - if Gitlab.ee? - optional :skip_ldap, type: Boolean, default: false, desc: 'Skip LDAP users' - end + use :optional_index_params_ee end # rubocop: disable CodeReuse/ActiveRecord get do |