diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-07 16:18:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-07 16:18:34 +0300 |
commit | 5cd677fa8419c817ef03956b269d9d4ff1d9ba28 (patch) | |
tree | 04f887cc426f488f60f783db8945c010eb3a7c6b /app/finders/starred_projects_finder.rb | |
parent | adc00b83fec99cfdd2b532b7892e7a242a38bfa8 (diff) |
Add latest changes from gitlab-org/security/gitlab@13-4-stable-eev13.4.7
Diffstat (limited to 'app/finders/starred_projects_finder.rb')
-rw-r--r-- | app/finders/starred_projects_finder.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/finders/starred_projects_finder.rb b/app/finders/starred_projects_finder.rb index fcb469d1d17..e209960c471 100644 --- a/app/finders/starred_projects_finder.rb +++ b/app/finders/starred_projects_finder.rb @@ -1,11 +1,22 @@ # frozen_string_literal: true class StarredProjectsFinder < ProjectsFinder + include Gitlab::Allowable + def initialize(user, params: {}, current_user: nil) + @user = user + super( params: params, current_user: current_user, project_ids_relation: user.starred_projects.select(:id) ) end + + def execute + # Do not show starred projects if the user has a private profile. + return Project.none unless can?(current_user, :read_user_profile, @user) + + super + end end |