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
diff options
context:
space:
mode:
authorBorja Aparicio <borja.aparicio.cotarelo@cern.ch>2016-10-25 16:22:12 +0300
committerBorja Aparicio <borja.aparicio.cotarelo@cern.ch>2016-11-08 12:55:35 +0300
commit4f2c4411615a7c870fd1fa54525079f7ea97d6e5 (patch)
treeca57b1d7a9c73af784300f637984c2746323d719 /lib
parentc2e2cde910008e148c0af49ee6135be0b3d7f7d9 (diff)
Added API endpoint groups/owned
Diffstat (limited to 'lib')
-rw-r--r--lib/api/groups.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index a13e353b7f5..40644fc2adf 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -26,6 +26,16 @@ module API
present @groups, with: Entities::Group
end
+ # Get list of owned groups for authenticated user
+ #
+ # Example Request:
+ # GET /groups/owned
+ get '/owned' do
+ @groups = current_user.owned_groups
+ @groups = paginate @groups
+ present @groups, with: Entities::Group, user: current_user
+ end
+
# Create group. Available only for users who can create groups.
#
# Parameters: