diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-07-08 09:34:36 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-07-08 10:30:52 +0200 |
commit | 0530ec5e6ec324c5b1dd6e450a534b204cae2118 (patch) | |
tree | 5299d4a459d72bb541e83b611032f6d95966abfa /lib/api | |
parent | 5541e55c491eb86567c8c1f28457e894a4155dd1 (diff) | |
download | gitlab-ce-api-shared-groups.tar.gz |
Expose shared groups for projectsapi-shared-groups
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 11 |
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 |