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.
This commit is contained in:
parent
9eefae6917
commit
f486b06c4d
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,7 @@ class PersonalProjectsFinder
|
||||||
authorized = @user.personal_projects.visible_to_user(current_user)
|
authorized = @user.personal_projects.visible_to_user(current_user)
|
||||||
|
|
||||||
union = Gitlab::SQL::Union.
|
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})")
|
Project.where("projects.id IN (#{union.to_sql})")
|
||||||
end
|
end
|
||||||
|
@ -34,4 +34,8 @@ class PersonalProjectsFinder
|
||||||
def public_projects
|
def public_projects
|
||||||
@user.personal_projects.public_only
|
@user.personal_projects.public_only
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def public_and_internal_projects
|
||||||
|
@user.personal_projects.public_and_internal_only
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue