diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-11-28 08:28:35 +0000 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2017-12-06 13:30:23 +0000 |
commit | a101a0a6130e9fb0efee7bb58086108be5489441 (patch) | |
tree | 0b6b725f2c8f6f8756ba0e8d900c6cfa131471eb /lib | |
parent | f45fc58d843b74065f522196d92af99a6566aeab (diff) | |
download | gitlab-ce-a101a0a6130e9fb0efee7bb58086108be5489441.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.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index a382db92e8d..bcc0f6f86c9 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -212,8 +212,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 |