diff options
Diffstat (limited to 'lib/api/invitations.rb')
-rw-r--r-- | lib/api/invitations.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/invitations.rb b/lib/api/invitations.rb index 34f9538b047..6b4b7b355d0 100644 --- a/lib/api/invitations.rb +++ b/lib/api/invitations.rb @@ -10,6 +10,12 @@ module API helpers ::API::Helpers::MembersHelpers + helpers do + params :invitation_params_ee do + # Overriden in EE + end + end + %w[group project].each do |source_type| params do requires :id, type: String, desc: "The #{source_type} ID" @@ -26,6 +32,8 @@ module API optional :user_id, type: Array[String], coerce_with: ::API::Validations::Types::CommaSeparatedToArray.coerce, desc: 'The user ID of the new member or multiple IDs separated by commas.' optional :expires_at, type: DateTime, desc: 'Date string in the format YEAR-MONTH-DAY' optional :invite_source, type: String, desc: 'Source that triggered the member creation process', default: 'invitations-api' + + use :invitation_params_ee end post ":id/invitations", urgency: :low do ::Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/354016') @@ -80,6 +88,8 @@ module API requires :email, type: String, desc: 'The email address of the invitation' optional :access_level, type: Integer, values: Gitlab::Access.all_values, desc: 'A valid access level (defaults: `30`, developer access level)' optional :expires_at, type: DateTime, desc: 'Date string in ISO 8601 format (`YYYY-MM-DDTHH:MM:SSZ`)' + + use :invitation_params_ee end put ":id/invitations/:email", requirements: { email: %r{[^/]+} } do source = find_source(source_type, params.delete(:id)) @@ -145,3 +155,5 @@ module API end end end + +API::Members.prepend_mod |