summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-11-18 15:08:28 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2015-11-18 15:08:28 +0100
commitf486b06c4de26e7eb6468cfc4f864b50e645d5c7 (patch)
tree7067e346e7e4fac60eb93bcbfd93a32b0a5b4363 /app
parent9eefae69171ba199d34bccf504902500a980fcb3 (diff)
downloadgitlab-ce-f486b06c4de26e7eb6468cfc4f864b50e645d5c7.tar.gz
Return internal projects in PersonalProjectsFinder
When getting the projects of a user we should get the public _and_ internal projects, not just the public ones.
Diffstat (limited to 'app')
-rw-r--r--app/finders/personal_projects_finder.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/finders/personal_projects_finder.rb b/app/finders/personal_projects_finder.rb
index 7c039573614..a61ffa22990 100644
--- a/app/finders/personal_projects_finder.rb
+++ b/app/finders/personal_projects_finder.rb
@@ -26,7 +26,7 @@ class PersonalProjectsFinder
authorized = @user.personal_projects.visible_to_user(current_user)
union = Gitlab::SQL::Union.
- new([authorized.select(:id), public_projects.select(:id)])
+ new([authorized.select(:id), public_and_internal_projects.select(:id)])
Project.where("projects.id IN (#{union.to_sql})")
end
@@ -34,4 +34,8 @@ class PersonalProjectsFinder
def public_projects
@user.personal_projects.public_only
end
+
+ def public_and_internal_projects
+ @user.personal_projects.public_and_internal_only
+ end
end