Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
6d76e000
Commit
6d76e000
authored
Sep 10, 2012
by
miks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add authorization to hooks requests
parent
2e34a6d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
lib/api/projects.rb
lib/api/projects.rb
+3
-0
No files found.
lib/api/projects.rb
View file @
6d76e000
...
...
@@ -113,6 +113,7 @@ module Gitlab
# Example Request:
# GET /projects/:id/hooks
get
":id/hooks"
do
authorize!
:admin_project
,
user_project
@hooks
=
paginate
user_project
.
hooks
present
@hooks
,
with:
Entities
::
Hook
end
...
...
@@ -125,6 +126,7 @@ module Gitlab
# Example Request:
# POST /projects/:id/hooks
post
":id/hooks"
do
authorize!
:admin_project
,
user_project
@hook
=
user_project
.
hooks
.
new
({
"url"
=>
params
[
:url
]})
if
@hook
.
save
present
@hook
,
with:
Entities
::
Hook
...
...
@@ -141,6 +143,7 @@ module Gitlab
# Example Request:
# DELETE /projects/:id/hooks
delete
":id/hooks"
do
authorize!
:admin_project
,
user_project
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
@hook
.
destroy
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment