Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-10-31 20:37:13 +0300
committerRémy Coutable <remy@rymai.me>2016-10-31 20:47:30 +0300
commite5c6f943fe6e33510813f05a6f7e6d56af47461a (patch)
treed93062daf78ef0179cf96c071cdb999e0ccca74e /lib/api
parenta60cc42b262cb63ce5d2284f1f3f41d6521daa14 (diff)
Backport Group API code that was added in EE only
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/groups.rb3
1 files changed, 3 insertions, 0 deletions
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