Commit eb53bce4 authored by Thiago Figueiró's avatar Thiago Figueiró

Remove instance_security_dashboard feature flag

Changelog: removed
parent 5844f1b7
......@@ -4,9 +4,7 @@ module Security
class ApplicationController < ::ApplicationController
include SecurityDashboardsPermissions
before_action :check_feature_enabled!
before_action do
push_frontend_feature_flag(:instance_security_dashboard, default_enabled: true)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end
......@@ -14,10 +12,6 @@ module Security
protected
def check_feature_enabled!
render_404 unless Feature.enabled?(:instance_security_dashboard, default_enabled: true)
end
def vulnerable
@vulnerable ||= InstanceSecurityDashboard.new(
current_user,
......
......@@ -50,8 +50,7 @@ module EE
def security_dashboard_available?
security_dashboard = InstanceSecurityDashboard.new(current_user)
::Feature.enabled?(:instance_security_dashboard, default_enabled: true) &&
security_dashboard.feature_available?(:security_dashboard) &&
security_dashboard.feature_available?(:security_dashboard) &&
can?(current_user, :read_instance_security_dashboard, security_dashboard)
end
end
......
---
name: instance_security_dashboard
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24505
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/259285
milestone: '12.8'
type: development
group: group::threat insights
default_enabled: true
......@@ -153,16 +153,6 @@ RSpec.describe Security::ProjectsController do
end
end
context 'and the security dashboard feature is disabled' do
it '404s' do
stub_feature_flags(instance_security_dashboard: false)
subject
expect(response).to have_gitlab_http_status(:not_found)
end
end
it "removes the project from the current user's security dashboard" do
subject
......
......@@ -79,41 +79,24 @@ RSpec.describe DashboardHelper, type: :helper do
end
describe 'security dashboard link' do
context 'when the feature is enabled' do
context 'and the feature is available on the license' do
before do
stub_feature_flags(instance_security_dashboard: true)
stub_licensed_features(security_dashboard: true)
end
context 'and the feature is available on the license' do
context 'and the user is authenticated' do
before do
stub_licensed_features(security_dashboard: true)
end
context 'and the user is authenticated' do
before do
stub_user_permissions_for(:security, true)
end
it 'is included in the nav' do
expect(helper.dashboard_nav_links).to include(:security)
end
stub_user_permissions_for(:security, true)
end
context 'and the user is not authenticated' do
before do
stub_user_permissions_for(:security, false)
end
it 'is not included in the nav' do
expect(helper.dashboard_nav_links).not_to include(:security)
end
it 'is included in the nav' do
expect(helper.dashboard_nav_links).to include(:security)
end
end
context 'when the feature is not available on the license' do
context 'and the user is not authenticated' do
before do
stub_licensed_features(security_dashboard: false)
stub_user_permissions_for(:security, true)
stub_user_permissions_for(:security, false)
end
it 'is not included in the nav' do
......@@ -122,10 +105,9 @@ RSpec.describe DashboardHelper, type: :helper do
end
end
context 'when the feature is not enabled' do
context 'when the feature is not available on the license' do
before do
stub_feature_flags(instance_security_dashboard: false)
stub_licensed_features(security_dashboard: true)
stub_licensed_features(security_dashboard: false)
stub_user_permissions_for(:security, true)
end
......
......@@ -24,16 +24,6 @@ RSpec.shared_examples Security::ApplicationController do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'and the security dashboard feature is disabled' do
it '404s' do
stub_feature_flags(instance_security_dashboard: false)
security_application_controller_child_action
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
context 'when the user is not authenticated' do
......
......@@ -25,16 +25,6 @@ RSpec.shared_examples 'security dashboard JSON endpoint' do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'and the security dashboard feature is disabled' do
it '404s' do
stub_feature_flags(instance_security_dashboard: false)
security_dashboard_request
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
context 'when the user is not authenticated' 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