summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-11-28 08:28:35 +0000
committerMichael Kozono <mkozono@gmail.com>2017-12-08 13:48:14 -0800
commit8f29d2640ffb29c7ca8c0ab1136aa1959582db3a (patch)
tree72517afec1c95cedaa01f8a3a53f49468d42db0f /lib
parent8c0aa7d4a791cd05eddd9163fdc8270b933ffc6b (diff)
downloadgitlab-ce-8f29d2640ffb29c7ca8c0ab1136aa1959582db3a.tar.gz
Merge branch 'rs-security-group-api' into 'security-10-2'
[10.2] Ensure we expose group projects using GroupProjectsFinder See merge request gitlab/gitlabhq!2234 (cherry picked from commit 072f8f2fd6ec794645375a16ca4ddc1cbeb76d7a) a2240338 Ensure we expose group projects using GroupProjectsFinder
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index d96e7f2770f..928706dfda7 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -248,8 +248,21 @@ module API
end
class GroupDetail < Group
- expose :projects, using: Entities::Project
- expose :shared_projects, using: Entities::Project
+ expose :projects, using: Entities::Project do |group, options|
+ GroupProjectsFinder.new(
+ group: group,
+ current_user: options[:current_user],
+ options: { only_owned: true }
+ ).execute
+ end
+
+ expose :shared_projects, using: Entities::Project do |group, options|
+ GroupProjectsFinder.new(
+ group: group,
+ current_user: options[:current_user],
+ options: { only_shared: true }
+ ).execute
+ end
end
class Commit < Grape::Entity