diff options
author | James Lopez <james@jameslopez.es> | 2016-11-18 14:05:29 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-18 14:05:29 +0300 |
commit | cb353d655bd8802c14a1e12e0fe78a1f7cc2e4ed (patch) | |
tree | 957a43197d95eaf81af9f570c30e44a2169e6179 /app | |
parent | c76ef847817ac6346b2f367be63f482ee2df382a (diff) |
added new build updater, specs and refactored allowed_ids
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/cycle_analytics/events_controller.rb | 10 |
1 files changed, 8 insertions, 2 deletions
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 |