diff options
author | Nick Thomas <nick@gitlab.com> | 2017-08-23 13:01:11 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-08-23 18:30:53 +0100 |
commit | 502d6464b07154d74eecbeddbf2cd6dba841380f (patch) | |
tree | 8ccbee521179782ab59f957a5e7d46c34f339fe3 /lib/api/groups.rb | |
parent | 99bb3dde251d127fb897eb01fcade7c7f3d8c063 (diff) | |
download | gitlab-ce-502d6464b07154d74eecbeddbf2cd6dba841380f.tar.gz |
Allow v4 API GET requests for groups to be unauthenticated
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r-- | lib/api/groups.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 49c3b2278c7..892fd239df4 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 @@ -48,10 +48,10 @@ module API end get do groups = if params[:owned] - current_user.owned_groups - elsif current_user.admin + current_user ? current_user.owned_groups : Group.none + elsif current_user&.admin? Group.all - elsif params[:all_available] + elsif params[:all_available] || current_user.nil? GroupsFinder.new(current_user).execute else current_user.groups |