From e5c6f943fe6e33510813f05a6f7e6d56af47461a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 31 Oct 2016 18:37:13 +0100 Subject: Backport Group API code that was added in EE only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- lib/api/groups.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/api') diff --git a/lib/api/groups.rb b/lib/api/groups.rb index bfb89475025..a13e353b7f5 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -8,11 +8,14 @@ module API # # Parameters: # skip_groups (optional) - Array of group ids to exclude from list + # all_available (optional, boolean) - Show all group that you have access to # Example Request: # GET /groups get do @groups = if current_user.admin Group.all + elsif params[:all_available] + GroupsFinder.new.execute(current_user) else current_user.groups end -- cgit v1.2.3