summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-07-08 09:34:36 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-07-08 10:30:52 +0200
commit0530ec5e6ec324c5b1dd6e450a534b204cae2118 (patch)
tree5299d4a459d72bb541e83b611032f6d95966abfa /lib/api
parent5541e55c491eb86567c8c1f28457e894a4155dd1 (diff)
downloadgitlab-ce-api-shared-groups.tar.gz
Expose shared groups for projectsapi-shared-groups
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index db877d2eeb0..90e51c29339 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -58,6 +58,14 @@ module API
expose :path, :path_with_namespace
end
+ class SharedGroup < Grape::Entity
+ expose :group_id
+ expose :group_name do |group_link, options|
+ group_link.group.name
+ end
+ expose :group_access, as: :group_access_level
+ end
+
class Project < Grape::Entity
expose :id, :description, :default_branch, :tag_list
expose :public?, as: :public
@@ -77,6 +85,9 @@ module API
expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? }
expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] }
expose :public_builds
+ expose :shared_with_groups do |project, options|
+ SharedGroup.represent(project.project_group_links.all, options)
+ end
end
class ProjectMember < UserBasic