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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
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
Show 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
...
@@ -113,6 +113,7 @@ module Gitlab
# Example Request:
# Example Request:
# GET /projects/:id/hooks
# GET /projects/:id/hooks
get
":id/hooks"
do
get
":id/hooks"
do
authorize!
:admin_project
,
user_project
@hooks
=
paginate
user_project
.
hooks
@hooks
=
paginate
user_project
.
hooks
present
@hooks
,
with:
Entities
::
Hook
present
@hooks
,
with:
Entities
::
Hook
end
end
...
@@ -125,6 +126,7 @@ module Gitlab
...
@@ -125,6 +126,7 @@ module Gitlab
# Example Request:
# Example Request:
# POST /projects/:id/hooks
# POST /projects/:id/hooks
post
":id/hooks"
do
post
":id/hooks"
do
authorize!
:admin_project
,
user_project
@hook
=
user_project
.
hooks
.
new
({
"url"
=>
params
[
:url
]})
@hook
=
user_project
.
hooks
.
new
({
"url"
=>
params
[
:url
]})
if
@hook
.
save
if
@hook
.
save
present
@hook
,
with:
Entities
::
Hook
present
@hook
,
with:
Entities
::
Hook
...
@@ -141,6 +143,7 @@ module Gitlab
...
@@ -141,6 +143,7 @@ module Gitlab
# Example Request:
# Example Request:
# DELETE /projects/:id/hooks
# DELETE /projects/:id/hooks
delete
":id/hooks"
do
delete
":id/hooks"
do
authorize!
:admin_project
,
user_project
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
@hook
.
destroy
@hook
.
destroy
nil
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