summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-02-25 11:00:24 +0000
committerRémy Coutable <remy@rymai.me>2019-02-26 12:24:39 +0100
commita555a227dd7a846e5b8e8c84839120d40f9d1090 (patch)
tree7834ad40f3da966653f7f5ed8a5bf0c118f0b1b1 /app/finders
parentafd290a444d09e84092e5a5d738bcf28ec71f3c6 (diff)
downloadgitlab-ce-a555a227dd7a846e5b8e8c84839120d40f9d1090.tar.gz
Merge branch 'filter-confidential-issues' into 'master'
Ability to filter confidential issues Closes #50747 See merge request gitlab-org/gitlab-ce!24960
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issues_finder.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index a0504ca0879..cb44575d6f1 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -69,7 +69,16 @@ class IssuesFinder < IssuableFinder
end
def filter_items(items)
- by_due_date(super)
+ issues = super
+ issues = by_due_date(issues)
+ issues = by_confidential(issues)
+ issues
+ end
+
+ def by_confidential(items)
+ return items if params[:confidential].nil?
+
+ params[:confidential] ? items.confidential_only : items.public_only
end
def by_due_date(items)