diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/finders/ci/daily_build_group_report_results_finder.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/finders/ci/daily_build_group_report_results_finder.rb')
-rw-r--r-- | app/finders/ci/daily_build_group_report_results_finder.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/app/finders/ci/daily_build_group_report_results_finder.rb b/app/finders/ci/daily_build_group_report_results_finder.rb index 3c3c24c1479..774f08d1ff2 100644 --- a/app/finders/ci/daily_build_group_report_results_finder.rb +++ b/app/finders/ci/daily_build_group_report_results_finder.rb @@ -14,21 +14,25 @@ module Ci end def execute - return none unless can?(current_user, :download_code, project) + return none unless can?(current_user, :read_build_report_results, project) Ci::DailyBuildGroupReportResult.recent_results( - { - project_id: project, - ref_path: ref_path, - date: start_date..end_date - }, - limit: @limit + query_params, + limit: limit ) end private - attr_reader :current_user, :project, :ref_path, :start_date, :end_date + attr_reader :current_user, :project, :ref_path, :start_date, :end_date, :limit + + def query_params + { + project_id: project, + ref_path: ref_path, + date: start_date..end_date + } + end def none Ci::DailyBuildGroupReportResult.none |