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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9765f172
Commit
9765f172
authored
Mar 06, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check flag for issue links
parent
68cf6b34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
ee/lib/api/vulnerability_issue_links.rb
ee/lib/api/vulnerability_issue_links.rb
+4
-1
ee/spec/support/shared_examples/requests/api/vulnerabilities_shared_examples.rb
..._examples/requests/api/vulnerabilities_shared_examples.rb
+0
-1
No files found.
ee/lib/api/vulnerability_issue_links.rb
View file @
9765f172
...
...
@@ -33,6 +33,7 @@ module API
end
get
':id/issue_links'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:read_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
present
vulnerability
.
related_issues
...
...
@@ -50,6 +51,7 @@ module API
end
post
':id/issue_links'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
issue
=
find_project_issue
(
params
[
:target_issue_iid
],
vulnerability
.
project_id
)
response
=
::
VulnerabilityIssueLinks
::
CreateService
.
new
(
...
...
@@ -65,7 +67,8 @@ module API
requires
:issue_link_id
,
type:
Integer
,
desc:
'The ID of a vulnerability-issue-link to delete'
end
delete
':id/issue_links/:issue_link_id'
do
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
issue_link
=
find_issue_link!
service_response
=
::
VulnerabilityIssueLinks
::
DeleteService
.
new
(
current_user
,
issue_link
).
execute
...
...
ee/spec/support/shared_examples/requests/api/vulnerabilities_shared_examples.rb
View file @
9765f172
...
...
@@ -4,7 +4,6 @@ RSpec.shared_examples 'forbids access to vulnerability API endpoint in case of d
context
'when "first-class vulnerabilities" feature is disabled'
do
before
do
stub_feature_flags
(
first_class_vulnerabilities:
false
)
stub_feature_flags
(
first_class_vulnerabilities:
{
enabled:
false
,
thing:
project
})
end
it
'responds with "not found"'
do
...
...
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