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
d8e6386b
Commit
d8e6386b
authored
Apr 26, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '15579-filter-milestone-confidential-issues-api' into 'master'"
This reverts commit
550f9a74
.
parent
9c3df5cf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
39 deletions
+2
-39
lib/api/milestones.rb
lib/api/milestones.rb
+1
-9
spec/requests/api/milestones_spec.rb
spec/requests/api/milestones_spec.rb
+1
-30
No files found.
lib/api/milestones.rb
View file @
d8e6386b
...
@@ -87,15 +87,7 @@ module API
...
@@ -87,15 +87,7 @@ module API
authorize!
:read_milestone
,
user_project
authorize!
:read_milestone
,
user_project
@milestone
=
user_project
.
milestones
.
find
(
params
[
:milestone_id
])
@milestone
=
user_project
.
milestones
.
find
(
params
[
:milestone_id
])
present
paginate
(
@milestone
.
issues
),
with:
Entities
::
Issue
finder_params
=
{
project_id:
user_project
.
id
,
milestone_title:
@milestone
.
title
,
state:
'all'
}
issues
=
IssuesFinder
.
new
(
current_user
,
finder_params
).
execute
present
paginate
(
issues
),
with:
Entities
::
Issue
,
current_user:
current_user
end
end
end
end
...
...
spec/requests/api/milestones_spec.rb
View file @
d8e6386b
...
@@ -106,7 +106,7 @@ describe API::API, api: true do
...
@@ -106,7 +106,7 @@ describe API::API, api: true do
describe
'GET /projects/:id/milestones/:milestone_id/issues'
do
describe
'GET /projects/:id/milestones/:milestone_id/issues'
do
before
do
before
do
milestone
.
issues
<<
create
(
:issue
,
project:
project
)
milestone
.
issues
<<
create
(
:issue
)
end
end
it
'should return project issues for a particular milestone'
do
it
'should return project issues for a particular milestone'
do
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
,
user
)
...
@@ -119,34 +119,5 @@ describe API::API, api: true do
...
@@ -119,34 +119,5 @@ describe API::API, api: true do
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
)
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
)
expect
(
response
.
status
).
to
eq
(
401
)
expect
(
response
.
status
).
to
eq
(
401
)
end
end
describe
'confidential issues'
do
let
(
:public_project
)
{
create
(
:project
,
:public
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
public_project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
public_project
)
}
let
(
:confidential_issue
)
{
create
(
:issue
,
confidential:
true
,
project:
public_project
)
}
before
do
public_project
.
team
<<
[
user
,
:developer
]
milestone
.
issues
<<
issue
<<
confidential_issue
end
it
'returns confidential issues to team members'
do
get
api
(
"/projects/
#{
public_project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
,
user
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
size
).
to
eq
(
2
)
expect
(
json_response
.
map
{
|
issue
|
issue
[
'id'
]
}).
to
include
(
issue
.
id
,
confidential_issue
.
id
)
end
it
'does not return confidential issues to regular users'
do
get
api
(
"/projects/
#{
public_project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
,
create
(
:user
))
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
map
{
|
issue
|
issue
[
'id'
]
}).
to
include
(
issue
.
id
)
end
end
end
end
end
end
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