diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx index 165aa5a30b0f0..aea75b5b3b796 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx @@ -14,6 +14,14 @@ jest.mock('../../../../common/lib/kibana', () => ({ services: { application: { getUrlForApp: jest.fn(), + capabilities: { + siem: { + crud: true, + }, + actions: { + read: true, + }, + }, }, triggers_actions_ui: { actionTypeRegistry: jest.fn(), diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx index e6f1c25bf9dac..77168e62492c6 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx @@ -11,6 +11,7 @@ import { EuiFlexItem, EuiButton, EuiSpacer, + EuiText, } from '@elastic/eui'; import { findIndex } from 'lodash/fp'; import React, { FC, memo, useCallback, useEffect, useMemo } from 'react'; @@ -141,37 +142,61 @@ const StepRuleActionsComponent: FC = ({ [isLoading, throttleOptions] ); - return isReadOnlyView ? ( - - - + if (isReadOnlyView) { + return ( + + + + ); + } + + const displayActionsOptions = + throttle !== stepActionsDefaultValue.throttle ? ( + <> + + + + ) : ( + + ); + + // only display the actions dropdown if the user has "read" privileges for actions + const displayActionsDropDown = application.capabilities.actions.show ? ( + <> + + {displayActionsOptions} + + + ) : ( + <> + {I18n.NO_ACTIONS_READ_PERMISSIONS} + + + + + + ); + + return ( <>
- - - {throttle !== stepActionsDefaultValue.throttle ? ( - <> - - - - ) : ( - - )} - - - + {displayActionsDropDown}
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx index a276cb17e95f5..b2677b761aabf 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx @@ -28,6 +28,14 @@ export const NO_CONNECTOR_SELECTED = i18n.translate( } ); +export const NO_ACTIONS_READ_PERMISSIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepRuleActions.noReadActionsPrivileges', + { + defaultMessage: + 'Cannot create rule actions. You do not have "Read" permissions for the "Actions" plugin.', + } +); + export const INVALID_MUSTACHE_TEMPLATE = (paramKey: string) => i18n.translate( 'xpack.securitySolution.detectionEngine.createRule.stepRuleActions.invalidMustacheTemplateErrorMessage',