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
986beb89
Commit
986beb89
authored
Mar 03, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checks project feature flag for 1st class vulns
parent
960eff07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
ee/lib/api/helpers/vulnerabilities_hooks.rb
ee/lib/api/helpers/vulnerabilities_hooks.rb
+2
-2
ee/lib/api/vulnerabilities.rb
ee/lib/api/vulnerabilities.rb
+4
-0
No files found.
ee/lib/api/helpers/vulnerabilities_hooks.rb
View file @
986beb89
...
...
@@ -6,8 +6,8 @@ module API
extend
ActiveSupport
::
Concern
included
do
before
do
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
)
after
do
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
@project
)
authenticate!
end
...
...
ee/lib/api/vulnerabilities.rb
View file @
986beb89
...
...
@@ -34,6 +34,7 @@ module API
end
get
':id'
do
vulnerability
=
Vulnerability
.
find
(
params
[
:id
])
@project
=
vulnerability
.
project
authorize_vulnerability!
(
vulnerability
,
:read_vulnerability
)
render_vulnerability
(
vulnerability
)
end
...
...
@@ -43,6 +44,7 @@ module API
end
post
':id/resolve'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
@project
=
vulnerability
.
project
break
not_modified!
if
vulnerability
.
resolved?
vulnerability
=
::
Vulnerabilities
::
ResolveService
.
new
(
current_user
,
vulnerability
).
execute
...
...
@@ -54,6 +56,7 @@ module API
end
post
':id/dismiss'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
@project
=
vulnerability
.
project
break
not_modified!
if
vulnerability
.
dismissed?
vulnerability
=
::
Vulnerabilities
::
DismissService
.
new
(
current_user
,
vulnerability
).
execute
...
...
@@ -65,6 +68,7 @@ module API
end
post
':id/confirm'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
@project
=
vulnerability
.
project
break
not_modified!
if
vulnerability
.
confirmed?
vulnerability
=
::
Vulnerabilities
::
ConfirmService
.
new
(
current_user
,
vulnerability
).
execute
...
...
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