Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-24 03:09:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-24 03:09:26 +0300
commit27f3465d8a52afce630417b6e4b58992b6e403fe (patch)
tree55a48a13e9db76ca804ecba4b5ffa12a65076944 /app/finders/issues_finder.rb
parent78f935d56652eee385683bf7a55c3b9a86a63a0e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/issues_finder.rb')
-rw-r--r--app/finders/issues_finder.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index 5c9010ee3e0..fbf71a24f7e 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -47,6 +47,15 @@ class IssuesFinder < IssuableFinder
# rubocop: disable CodeReuse/ActiveRecord
def with_confidentiality_access_check
return Issue.all if params.user_can_see_all_confidential_issues?
+
+ if Feature.enabled?(:optimize_issue_filter_assigned_to_self, default_enabled: :yaml)
+ # If already filtering by assignee we can skip confidentiality since a user
+ # can always see confidential issues assigned to them. This is just an
+ # optimization since a very common usecase of this Finder is to load the
+ # count of issues assigned to the user for the header bar.
+ return Issue.all if current_user && params.assignees.include?(current_user)
+ end
+
return Issue.where('issues.confidential IS NOT TRUE') if params.user_cannot_see_confidential_issues?
Issue.where('