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
2b9702e9
Commit
2b9702e9
authored
Jul 11, 2019
by
Avielle Wolfe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make VulnerabilitiesActions module agnostic
parent
509ad2c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
ee/app/controllers/concerns/vulnerabilities_actions.rb
ee/app/controllers/concerns/vulnerabilities_actions.rb
+7
-1
ee/app/controllers/groups/security/vulnerabilities_controller.rb
...controllers/groups/security/vulnerabilities_controller.rb
+6
-0
No files found.
ee/app/controllers/concerns/vulnerabilities_actions.rb
View file @
2b9702e9
# frozen_string_literal: true
# The VulnerabilitiesActions concern contains actions that are used to populate vulnerabilities
# on security dashboards.
#
# Note: Consumers of this module will need to define a `def vulnerable` method, which must return
# an object with an interface that matches the one provided by the Vulnerable model concern.
module
VulnerabilitiesActions
extend
ActiveSupport
::
Concern
...
...
@@ -46,6 +52,6 @@ module VulnerabilitiesActions
end
def
found_vulnerabilities
(
collection
=
:latest
)
::
Security
::
VulnerabilitiesFinder
.
new
(
group
,
params:
filter_params
).
execute
(
collection
)
::
Security
::
VulnerabilitiesFinder
.
new
(
vulnerable
,
params:
filter_params
).
execute
(
collection
)
end
end
ee/app/controllers/groups/security/vulnerabilities_controller.rb
View file @
2b9702e9
...
...
@@ -2,4 +2,10 @@
class
Groups::Security::VulnerabilitiesController
<
Groups
::
Security
::
ApplicationController
include
VulnerabilitiesActions
private
def
vulnerable
group
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