[Security Solution] - remove alerts subfeature UI from behind feature flag (#108450)

### Summary
This removes the feature flag check for showing the alerts subfeature under security solution Kibana roles UI.
This commit is contained in:
Yara Tercero 2021-08-13 21:12:31 -07:00 committed by GitHub
parent a7661a553c
commit 94d16f8882
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 13 deletions

View file

@ -76,7 +76,7 @@ export const getAlertsSubFeature = (ruleTypes: string[]): SubFeatureConfig => ({
all: [],
read: [],
},
ui: [],
ui: ['crud_alerts', 'read_alerts'],
},
{
id: 'alerts_read',
@ -93,17 +93,14 @@ export const getAlertsSubFeature = (ruleTypes: string[]): SubFeatureConfig => ({
all: [],
read: [],
},
ui: [],
ui: ['read_alerts'],
},
],
},
],
});
export const getKibanaPrivilegesFeaturePrivileges = (
ruleTypes: string[],
isRuleRegistryEnabled: boolean
): KibanaFeatureConfig => ({
export const getKibanaPrivilegesFeaturePrivileges = (ruleTypes: string[]): KibanaFeatureConfig => ({
id: SERVER_APP_ID,
name: i18n.translate('xpack.securitySolution.featureRegistry.linkSecuritySolutionTitle', {
defaultMessage: 'Security',
@ -117,9 +114,7 @@ export const getKibanaPrivilegesFeaturePrivileges = (
},
alerting: ruleTypes,
cases: [APP_ID],
subFeatures: isRuleRegistryEnabled
? [{ ...CASES_SUB_FEATURE }, { ...getAlertsSubFeature(ruleTypes) }]
: [{ ...CASES_SUB_FEATURE }],
subFeatures: [{ ...CASES_SUB_FEATURE }, { ...getAlertsSubFeature(ruleTypes) }],
privileges: {
all: {
app: [APP_ID, 'kibana'],

View file

@ -310,9 +310,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
...(isRuleRegistryEnabled ? racRuleTypes : []),
];
plugins.features.registerKibanaFeature(
getKibanaPrivilegesFeaturePrivileges(ruleTypes, isRuleRegistryEnabled)
);
plugins.features.registerKibanaFeature(getKibanaPrivilegesFeaturePrivileges(ruleTypes));
// Continue to register legacy rules against alerting client exposed through rule-registry
if (this.setupPlugins.alerting != null) {

View file

@ -32,7 +32,16 @@ export default function ({ getService }: FtrProviderContext) {
actions: ['all', 'read'],
stackAlerts: ['all', 'read'],
ml: ['all', 'read'],
siem: ['all', 'read', 'minimal_all', 'minimal_read', 'cases_all', 'cases_read'],
siem: [
'all',
'read',
'minimal_all',
'minimal_read',
'cases_all',
'cases_read',
'alerts_all',
'alerts_read',
],
observabilityCases: ['all', 'read'],
uptime: ['all', 'read'],
infrastructure: ['all', 'read'],