diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx index 5ba3a6b95f7b1..9eeecc04ff784 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx @@ -28,6 +28,8 @@ import { ENABLEMENT_DESCRIPTION_RISK_ENGINE_ONLY, ENABLEMENT_DESCRIPTION_ENTITY_STORE_ONLY, } from '../translations'; +import { useMissingRiskEnginePrivileges } from '../../../hooks/use_missing_risk_engine_privileges'; +import { RiskEnginePrivilegesCallOut } from '../../risk_engine_privileges_callout'; export interface Enablements { riskScore: boolean; @@ -59,6 +61,7 @@ export const EntityStoreEnablementModal: React.FC } checked={enablements.riskScore} - disabled={riskScore.disabled || false} + disabled={ + riskScore.disabled || + (!riskEnginePrivileges.isLoading && !riskEnginePrivileges?.hasAllRequiredPrivileges) + } onChange={() => setEnablements((prev) => ({ ...prev, riskScore: !prev.riskScore }))} /> + {!riskEnginePrivileges.isLoading && !riskEnginePrivileges.hasAllRequiredPrivileges && ( + + + + )} {ENABLEMENT_DESCRIPTION_RISK_ENGINE_ONLY} - } checked={enablements.entityStore} - disabled={entityStore.disabled || false} + disabled={entityStore.disabled} onChange={() => setEnablements((prev) => ({ ...prev, entityStore: !prev.entityStore })) }