diff options
author | Nick Thomas <nick@gitlab.com> | 2019-08-16 15:11:30 +0100 |
---|---|---|
committer | Himanshu Kapoor <hkapoor@gitlab.com> | 2019-08-19 14:21:56 +0530 |
commit | f7f91e84f71afa6bcf8a22ed181ce719bfbaf35c (patch) | |
tree | d1b3c63affba9c4349b23d2244fddb05cf5912cc /lib | |
parent | bbf639c43d689bd63a32ef7a60bdf83d3bd329bf (diff) | |
download | gitlab-ce-f7f91e84f71afa6bcf8a22ed181ce719bfbaf35c.tar.gz |
Add a skip_users filter to the project users API
This functionality is available in the /autocomplete users pseudo-API.
We're attempting to replace that with the canonical API, so it needs
support for this parameter too.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 996205d4b7b..3073c14b341 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -489,11 +489,13 @@ module API end params do optional :search, type: String, desc: 'Return list of users matching the search criteria' + optional :skip_users, type: Array[Integer], desc: 'Filter out users with the specified IDs' use :pagination end get ':id/users' do users = DeclarativePolicy.subject_scope { user_project.team.users } users = users.search(params[:search]) if params[:search].present? + users = users.where_not_in(params[:skip_users]) if params[:skip_users].present? present paginate(users), with: Entities::UserBasic end |