diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-03-20 21:30:08 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-03-20 21:30:08 +0100 |
commit | 3058a8fa4c1dfdf50a6f274bfbf280f8d2137168 (patch) | |
tree | 8e0ac2d83bbb4bf8f6727c3230c8dc0d59aa61a8 /app/finders | |
parent | fd8d44ca6188b2ad9d6931ce385e61217724a712 (diff) | |
download | gitlab-ce-3058a8fa4c1dfdf50a6f274bfbf280f8d2137168.tar.gz |
Fix "Shared projects" tab
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/group_projects_finder.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/finders/group_projects_finder.rb b/app/finders/group_projects_finder.rb index 84fe468ae5d..2470af7c685 100644 --- a/app/finders/group_projects_finder.rb +++ b/app/finders/group_projects_finder.rb @@ -13,29 +13,29 @@ class GroupProjectsFinder < UnionFinder private def group_projects(current_user) - include_owned = @options.fetch(:owned, true) - include_shared = @options.fetch(:shared, true) + only_owned = @options.fetch(:only_owned, false) + only_shared = @options.fetch(:only_shared, false) projects = [] if current_user if @group.users.include?(current_user) - projects << @group.projects if include_owned - projects << @group.shared_projects if include_shared + projects << @group.projects unless only_shared + projects << @group.shared_projects unless only_owned else - if include_owned + unless only_shared projects << @group.projects.visible_to_user(current_user) projects << @group.projects.public_to_user(current_user) end - if include_shared + unless only_owned projects << @group.shared_projects.visible_to_user(current_user) projects << @group.shared_projects.public_to_user(current_user) end end else - projects << @group.projects.public_only if include_owned - projects << @group.shared_projects.public_only if include_shared + projects << @group.projects.public_only unless only_shared + projects << @group.shared_projects.public_only unless only_owned end projects |