diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2019-02-20 14:20:58 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-02-21 14:02:38 +0100 |
commit | 73e3a1cd02c5d2bdaf03d5998ae12bc86de2fa75 (patch) | |
tree | f3ee328b37f9535539e270898b79579acfd89ce7 /lib/api/issues.rb | |
parent | 66c9a311cc1251d9046e4bb2936841a57bcd1c9c (diff) | |
download | gitlab-ce-73e3a1cd02c5d2bdaf03d5998ae12bc86de2fa75.tar.gz |
Add API support for filtering confidential issues
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r-- | lib/api/issues.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 94ed9ac6fb1..3862c29d841 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -15,6 +15,14 @@ module API params :issue_params_ee do end + + def convert_confidential_param(args) + confidential = args.delete(:confidential) + return args if confidential.nil? + + args[:confidential] = confidential ? 'yes' : 'no' + args + end end helpers do @@ -26,6 +34,7 @@ module API args[:milestone_title] = args.delete(:milestone) args[:label_name] = args.delete(:labels) args[:scope] = args[:scope].underscore if args[:scope] + args = convert_confidential_param(args) issues = IssuesFinder.new(current_user, args).execute .preload(:assignees, :labels, :notes, :timelogs, :project, :author, :closed_by) @@ -54,6 +63,7 @@ module API optional :scope, type: String, values: %w[created-by-me assigned-to-me created_by_me assigned_to_me all], desc: 'Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`' optional :my_reaction_emoji, type: String, desc: 'Return issues reacted by the authenticated user by the given emoji' + optional :confidential, type: Boolean, desc: 'Filter confidential or public issues' use :pagination use :issues_params_ee |