summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-02-25 11:00:24 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-02-25 11:00:24 +0000
commitd133bf84c668df3dfc9938bb04150754cb873c8b (patch)
treefacaf21c2b334c24718fec0c1c2a46976b4ede72 /app/finders
parent7981c0292b07a0138b096fa082341fcb13e9ce2b (diff)
parentbf7846bec07157a8023770d03854834cceb69e3d (diff)
downloadgitlab-ce-d133bf84c668df3dfc9938bb04150754cb873c8b.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)