Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-18 14:05:29 +0300
committerJames Lopez <james@jameslopez.es>2016-11-18 14:05:29 +0300
commitcb353d655bd8802c14a1e12e0fe78a1f7cc2e4ed (patch)
tree957a43197d95eaf81af9f570c30e44a2169e6179 /app/controllers/projects/cycle_analytics
parentc76ef847817ac6346b2f367be63f482ee2df382a (diff)
added new build updater, specs and refactored allowed_ids
Diffstat (limited to 'app/controllers/projects/cycle_analytics')
-rw-r--r--app/controllers/projects/cycle_analytics/events_controller.rb10
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