From cb353d655bd8802c14a1e12e0fe78a1f7cc2e4ed Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 18 Nov 2016 12:05:29 +0100 Subject: added new build updater, specs and refactored allowed_ids --- app/controllers/projects/cycle_analytics/events_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/cycle_analytics') diff --git a/app/controllers/projects/cycle_analytics/events_controller.rb b/app/controllers/projects/cycle_analytics/events_controller.rb index 8c2fb98a120..d5e98228ddc 100644 --- a/app/controllers/projects/cycle_analytics/events_controller.rb +++ b/app/controllers/projects/cycle_analytics/events_controller.rb @@ -5,7 +5,9 @@ module Projects before_action :authorize_read_cycle_analytics! before_action :authorize_builds!, only: [:test, :staging] - + before_action :authorize_read_issue!, only: [:issue, :production] + before_action :authorize_read_merge_request!, only: [:code, :review] + def issue render_events(events.issue_events) end @@ -60,7 +62,11 @@ module Projects end def authorize_builds! - return access_denied! unless current_user.can?(:read_build, project) + return access_denied! unless can?(current_user, :read_build, project) + end + + def authorize_read_issue! + return access_denied! unless can?(current_user, :read_issue, project) end end end -- cgit v1.2.3