Skip to content
Snippets Groups Projects
Commit 502d6464 authored by Nick Thomas's avatar Nick Thomas
Browse files

Allow v4 API GET requests for groups to be unauthenticated

parent 99bb3dde
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment