Commit 3ca74e5d authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '13247-dependencies-permissions' into 'master'

Update permissions for Dependencies and Dependency list

See merge request gitlab-org/gitlab!21053
parents c87734e1 0afec539
...@@ -72,7 +72,7 @@ module EE ...@@ -72,7 +72,7 @@ module EE
end end
def collect_dependency_list_reports!(dependency_list_report) def collect_dependency_list_reports!(dependency_list_report)
if project.feature_available?(:dependency_list) if project.feature_available?(:dependency_scanning)
dependency_list = ::Gitlab::Ci::Parsers::Security::DependencyList.new(project, sha) dependency_list = ::Gitlab::Ci::Parsers::Security::DependencyList.new(project, sha)
each_report(::Ci::JobArtifact::DEPENDENCY_LIST_REPORT_FILE_TYPES) do |file_type, blob| each_report(::Ci::JobArtifact::DEPENDENCY_LIST_REPORT_FILE_TYPES) do |file_type, blob|
...@@ -84,7 +84,7 @@ module EE ...@@ -84,7 +84,7 @@ module EE
end end
def collect_licenses_for_dependency_list!(dependency_list_report) def collect_licenses_for_dependency_list!(dependency_list_report)
if project.feature_available?(:dependency_list) if project.feature_available?(:dependency_scanning)
dependency_list = ::Gitlab::Ci::Parsers::Security::DependencyList.new(project, sha) dependency_list = ::Gitlab::Ci::Parsers::Security::DependencyList.new(project, sha)
each_report(::Ci::JobArtifact::LICENSE_MANAGEMENT_REPORT_FILE_TYPES) do |file_type, blob| each_report(::Ci::JobArtifact::LICENSE_MANAGEMENT_REPORT_FILE_TYPES) do |file_type, blob|
......
...@@ -105,7 +105,6 @@ class License < ApplicationRecord ...@@ -105,7 +105,6 @@ class License < ApplicationRecord
cluster_health cluster_health
container_scanning container_scanning
dast dast
dependency_list
dependency_scanning dependency_scanning
epics epics
group_ip_restriction group_ip_restriction
......
...@@ -76,8 +76,8 @@ module EE ...@@ -76,8 +76,8 @@ module EE
end end
with_scope :subject with_scope :subject
condition(:dependency_list_enabled) do condition(:dependency_scanning_enabled) do
@subject.feature_available?(:dependency_list) @subject.feature_available?(:dependency_scanning)
end end
with_scope :subject with_scope :subject
...@@ -170,7 +170,7 @@ module EE ...@@ -170,7 +170,7 @@ module EE
rule { license_management_enabled & can?(:read_project) }.enable :read_software_license_policy rule { license_management_enabled & can?(:read_project) }.enable :read_software_license_policy
rule { dependency_list_enabled & can?(:download_code) }.enable :read_dependencies rule { dependency_scanning_enabled & can?(:download_code) }.enable :read_dependencies
rule { licenses_list_enabled & can?(:read_software_license_policy) }.enable :read_licenses_list rule { licenses_list_enabled & can?(:read_software_license_policy) }.enable :read_licenses_list
......
...@@ -19,7 +19,7 @@ describe Projects::DependenciesController do ...@@ -19,7 +19,7 @@ describe Projects::DependenciesController do
render_views render_views
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
it 'renders the show template' do it 'renders the show template' do
...@@ -52,7 +52,7 @@ describe Projects::DependenciesController do ...@@ -52,7 +52,7 @@ describe Projects::DependenciesController do
context 'when feature is available' do context 'when feature is available' do
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
it 'returns 404' do it 'returns 404' do
......
...@@ -22,7 +22,7 @@ describe Projects::Security::DependenciesController do ...@@ -22,7 +22,7 @@ describe Projects::Security::DependenciesController do
context 'when feature is available' do context 'when feature is available' do
before do before do
stub_licensed_features(dependency_list: true, license_management: true, security_dashboard: true) stub_licensed_features(dependency_scanning: true, license_management: true, security_dashboard: true)
end end
context 'when usage ping is collected' do context 'when usage ping is collected' do
...@@ -228,7 +228,7 @@ describe Projects::Security::DependenciesController do ...@@ -228,7 +228,7 @@ describe Projects::Security::DependenciesController do
let(:user) { guest } let(:user) { guest }
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
project.add_guest(user) project.add_guest(user)
get :index, params: params, format: :json get :index, params: params, format: :json
......
...@@ -240,7 +240,7 @@ describe Ci::Build do ...@@ -240,7 +240,7 @@ describe Ci::Build do
context 'with available licensed feature' do context 'with available licensed feature' do
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
it 'parses blobs and add the results to the report' do it 'parses blobs and add the results to the report' do
...@@ -277,7 +277,7 @@ describe Ci::Build do ...@@ -277,7 +277,7 @@ describe Ci::Build do
context 'with available licensed feature' do context 'with available licensed feature' do
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
it 'parses blobs and add found license' do it 'parses blobs and add found license' do
......
...@@ -277,7 +277,7 @@ describe Ci::Pipeline do ...@@ -277,7 +277,7 @@ describe Ci::Pipeline do
subject { pipeline.dependency_list_report } subject { pipeline.dependency_list_report }
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
context 'when pipeline has a build with dependency list reports' do context 'when pipeline has a build with dependency list reports' do
......
...@@ -730,9 +730,9 @@ describe ProjectPolicy do ...@@ -730,9 +730,9 @@ describe ProjectPolicy do
end end
describe 'read_dependencies' do describe 'read_dependencies' do
context 'when dependency list feature available' do context 'when dependency scanning feature available' do
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
context 'with public project' do context 'with public project' do
......
...@@ -11,7 +11,7 @@ describe API::Dependencies do ...@@ -11,7 +11,7 @@ describe API::Dependencies do
let(:params) { {} } let(:params) { {} }
before do before do
stub_licensed_features(dependency_list: true, security_dashboard: true) stub_licensed_features(dependency_scanning: true, security_dashboard: true)
end end
context 'with an authorized user with proper permissions' do context 'with an authorized user with proper permissions' do
......
...@@ -9,7 +9,7 @@ describe Security::DependencyListService do ...@@ -9,7 +9,7 @@ describe Security::DependencyListService do
subject { described_class.new(pipeline: pipeline, params: params).execute } subject { described_class.new(pipeline: pipeline, params: params).execute }
before do before do
stub_licensed_features(dependency_list: true) stub_licensed_features(dependency_scanning: true)
end end
context 'without params' do context 'without params' 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