summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWarren Parad <wparad@gmail.com>2018-07-15 15:00:48 +0200
committerWarren Parad <wparad@gmail.com>2018-08-16 19:52:52 +0200
commit8aed9f08fc681d5653c2bc4b688950caf525579b (patch)
treea83a8fd2c40b194fa400e40ff1529c48ce76b879 /lib
parent6f21652f0b79a614ad809dc028aaa28aee16732e (diff)
downloadgitlab-ce-8aed9f08fc681d5653c2bc4b688950caf525579b.tar.gz
Add authenticate to events api. fix #49255
Diffstat (limited to 'lib')
-rw-r--r--lib/api/events.rb5
1 files changed, 5 insertions, 0 deletions
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