diff options
| author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-26 10:55:20 +0200 |
|---|---|---|
| committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-26 10:55:20 +0200 |
| commit | 15ace6a910ecb889c58fd4838a4f9a9b710178c7 (patch) | |
| tree | 647da348e903d9acb86f6063e49d958f207ba874 /lib | |
| parent | e984a8a3543fa9a26308cea35a42046392f4a488 (diff) | |
| parent | 2be34630623711fc20ef8c101b5cef688f207cc1 (diff) | |
| download | gitlab-ce-15ace6a910ecb889c58fd4838a4f9a9b710178c7.tar.gz | |
Merge commit '2be34630623711fc20ef8c101b5cef688f207cc1' into backstage/gb/rename-ci-cd-processing-sidekiq-queuesbackstage/gb/rename-ci-cd-processing-sidekiq-queues
* commit '2be34630623711fc20ef8c101b5cef688f207cc1':
Common Docker Documentation Location in `gitlab-ce`
fix deprecation warning present during webpack compiles
Enable 5 lines of Sidekiq backtrace lines to aid in debugging
Add support for copying permalink to notes via more actions dropdown
Handle creating a nested group on MySQL correctly
Decrease statuses batch size even more in a migration
Fix repo editor scrollbar
Replace 'source/search_code.feature' spinach test with an rspec analog
Authorizations regarding OAuth - style confirmation
Update README.md
Refactor complicated API group finding rules into GroupsFinder
Fix group and project search for anonymous users
Document version Group Milestones API introduced
Allow v4 API GET requests for groups to be unauthenticated
Adjust a range and a size in stages statuses migration
Update README.md
Point to /developers on docs/administration/authentiq.md
Indexes GFM markdown guide
use inline links instead of referenced
Add index on ci_runners.contacted_at
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/api/groups.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 49c3b2278c7..e56427304a6 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -2,7 +2,7 @@ module API class Groups < Grape::API include PaginationParams - before { authenticate! } + before { authenticate_non_get! } helpers do params :optional_params_ce do @@ -47,16 +47,8 @@ module API use :pagination end get do - groups = if params[:owned] - current_user.owned_groups - elsif current_user.admin - Group.all - elsif params[:all_available] - GroupsFinder.new(current_user).execute - else - current_user.groups - end - + find_params = { all_available: params[:all_available], owned: params[:owned] } + groups = GroupsFinder.new(current_user, find_params).execute groups = groups.search(params[:search]) if params[:search].present? groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present? groups = groups.reorder(params[:order_by] => params[:sort]) |
