From 8aed9f08fc681d5653c2bc4b688950caf525579b Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Sun, 15 Jul 2018 15:00:48 +0200 Subject: Add authenticate to events api. fix #49255 --- lib/api/events.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/api/events.rb') diff --git a/lib/api/events.rb b/lib/api/events.rb index fc4ba5a3188..a415508a632 100644 --- a/lib/api/events.rb +++ b/lib/api/events.rb @@ -1,6 +1,7 @@ module API class Events < Grape::API include PaginationParams + include APIGuard helpers do params :event_filter_params do @@ -24,6 +25,8 @@ module API end resource :events do + allow_access_with_scope :read_user, if: -> (request) { request.get? } + desc "List currently authenticated user's events" do detail 'This feature was introduced in GitLab 9.3.' success Entities::Event @@ -46,6 +49,8 @@ module API requires :id, type: String, desc: 'The ID or Username of the user' end resource :users do + allow_access_with_scope :read_user, if: -> (request) { request.get? } + desc 'Get the contribution events of a specified user' do detail 'This feature was introduced in GitLab 8.13.' success Entities::Event -- cgit v1.2.3