Commit acae7503 authored by Tetiana Chupryna's avatar Tetiana Chupryna

Address review comments

parent 4f5b10d2
......@@ -4,12 +4,16 @@ module EE
module Projects
module Security
module ConfigurationPresenter
extend ::Gitlab::Utils::Override
private
override :can_toggle_autofix
def can_toggle_autofix
try(:auto_fix_permission)
end
override :autofix_enabled
def autofix_enabled
{
dependency_scanning: project_settings&.auto_fix_dependency_scanning,
......@@ -17,6 +21,7 @@ module EE
}
end
override :auto_fix_user_path
def auto_fix_user_path
'/' # TODO: real link will be updated with https://gitlab.com/gitlab-org/gitlab/-/issues/348463
end
......
......@@ -4,20 +4,21 @@ module EE
module Gitlab
module Security
module ScanConfiguration
extend ::Gitlab::Utils::Override
override :available?
def available?
super || project.licensed_feature_available?(type)
end
def configured?
configured
end
override :configuration_path
def configuration_path
configurable_scans[type] if available? || always_available?
end
private
override :configurable_scans
def configurable_scans
strong_memoize(:configurable_scans) do
{
......
......@@ -19,7 +19,9 @@ RSpec.describe ::Gitlab::Security::ScanConfiguration do
stub_licensed_features(sast: false)
end
it { is_expected.to be_truthy }
it 'core scanners (SAST, Secret Detection) are always available' do
is_expected.to be_truthy
end
end
context 'with licensed scanner that is available' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment