BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2f906430
Commit
2f906430
authored
Sep 04, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix security breaching
parent
bb22989c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+1
-1
pipeline_schedules_spec.rb
spec/requests/api/pipeline_schedules_spec.rb
+13
-1
No files found.
lib/api/pipeline_schedules.rb
View file @
2f906430
...
...
@@ -167,7 +167,7 @@ module API
.
pipeline_schedules
.
preload
(
:owner
,
:last_pipeline
)
.
find_by
(
id:
params
.
delete
(
:pipeline_schedule_id
)).
tap
do
|
pipeline_schedule
|
unless
pipeline_schedule
||
can?
(
current_user
,
:read_pipeline_schedule
,
pipeline_schedule
)
unless
can?
(
current_user
,
:read_pipeline_schedule
,
pipeline_schedule
)
not_found!
(
'Pipeline Schedule'
)
end
end
...
...
spec/requests/api/pipeline_schedules_spec.rb
View file @
2f906430
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
API
::
PipelineSchedules
do
set
(
:developer
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
public_builds:
false
)
}
before
do
project
.
add_developer
(
developer
)
...
...
@@ -110,6 +110,18 @@ describe API::PipelineSchedules do
end
end
context
'authenticated user with insufficient permissions'
do
before
do
project
.
add_guest
(
user
)
end
it
'does not return pipeline_schedules list'
do
get
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
"
,
user
)
expect
(
response
).
to
have_http_status
(
:not_found
)
end
end
context
'unauthenticated user'
do
it
'does not return pipeline_schedules list'
do
get
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
"
)
...
...
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