diff --git a/x-pack/plugins/cases/common/constants/index.ts b/x-pack/plugins/cases/common/constants/index.ts index a8b227b46f064..b2e78b98c0780 100644 --- a/x-pack/plugins/cases/common/constants/index.ts +++ b/x-pack/plugins/cases/common/constants/index.ts @@ -172,7 +172,7 @@ export const PUSH_CASES_CAPABILITY = 'push_cases' as const; export const CASES_SETTINGS_CAPABILITY = 'cases_settings' as const; export const CASES_CONNECTORS_CAPABILITY = 'cases_connectors' as const; export const REOPEN_CASES_CAPABILITY = 'reopen_cases' as const; -export const COMMENT_CASES_CAPABILITY = 'create_comment' as const; +export const CREATE_COMMENT_CAPABILITY = 'create_comment' as const; /** * Cases API Tags diff --git a/x-pack/plugins/cases/common/index.ts b/x-pack/plugins/cases/common/index.ts index ccac5d61486cf..bc258d491772b 100644 --- a/x-pack/plugins/cases/common/index.ts +++ b/x-pack/plugins/cases/common/index.ts @@ -55,7 +55,7 @@ export { CASES_CONNECTORS_CAPABILITY, GET_CONNECTORS_CONFIGURE_API_TAG, CASES_SETTINGS_CAPABILITY, - COMMENT_CASES_CAPABILITY, + CREATE_COMMENT_CAPABILITY, REOPEN_CASES_CAPABILITY, } from './constants'; diff --git a/x-pack/plugins/cases/common/ui/types.ts b/x-pack/plugins/cases/common/ui/types.ts index 6154748ea3288..027deb1628a0a 100644 --- a/x-pack/plugins/cases/common/ui/types.ts +++ b/x-pack/plugins/cases/common/ui/types.ts @@ -11,7 +11,7 @@ import type { DELETE_CASES_CAPABILITY, READ_CASES_CAPABILITY, UPDATE_CASES_CAPABILITY, - COMMENT_CASES_CAPABILITY, + CREATE_COMMENT_CAPABILITY, REOPEN_CASES_CAPABILITY, } from '..'; import type { @@ -319,6 +319,6 @@ export interface CasesCapabilities { [PUSH_CASES_CAPABILITY]: boolean; [CASES_CONNECTORS_CAPABILITY]: boolean; [CASES_SETTINGS_CAPABILITY]: boolean; - [COMMENT_CASES_CAPABILITY]: boolean; + [CREATE_COMMENT_CAPABILITY]: boolean; [REOPEN_CASES_CAPABILITY]: boolean; } diff --git a/x-pack/plugins/cases/common/utils/capabilities.ts b/x-pack/plugins/cases/common/utils/capabilities.ts index 2048e17a44568..c94f55fa82b0b 100644 --- a/x-pack/plugins/cases/common/utils/capabilities.ts +++ b/x-pack/plugins/cases/common/utils/capabilities.ts @@ -14,7 +14,7 @@ import { UPDATE_CASES_CAPABILITY, CASES_SETTINGS_CAPABILITY, REOPEN_CASES_CAPABILITY, - COMMENT_CASES_CAPABILITY, + CREATE_COMMENT_CAPABILITY, } from '../constants'; export interface CasesUiCapabilities { @@ -41,5 +41,5 @@ export const createUICapabilities = (): CasesUiCapabilities => ({ delete: [DELETE_CASES_CAPABILITY] as const, settings: [CASES_SETTINGS_CAPABILITY] as const, reopenCases: [REOPEN_CASES_CAPABILITY] as const, - createComment: [COMMENT_CASES_CAPABILITY] as const, + createComment: [CREATE_COMMENT_CAPABILITY] as const, }); diff --git a/x-pack/plugins/cases/public/client/helpers/capabilities.ts b/x-pack/plugins/cases/public/client/helpers/capabilities.ts index 3a0778c0508e7..7a05e56444ac8 100644 --- a/x-pack/plugins/cases/public/client/helpers/capabilities.ts +++ b/x-pack/plugins/cases/public/client/helpers/capabilities.ts @@ -15,7 +15,7 @@ import { READ_CASES_CAPABILITY, UPDATE_CASES_CAPABILITY, REOPEN_CASES_CAPABILITY, - COMMENT_CASES_CAPABILITY, + CREATE_COMMENT_CAPABILITY, } from '../../../common/constants'; export const getUICapabilities = ( @@ -29,7 +29,7 @@ export const getUICapabilities = ( const connectors = !!featureCapabilities?.[CASES_CONNECTORS_CAPABILITY]; const settings = !!featureCapabilities?.[CASES_SETTINGS_CAPABILITY]; const reopenCases = !!featureCapabilities?.[REOPEN_CASES_CAPABILITY]; - const createComment = !!featureCapabilities?.[COMMENT_CASES_CAPABILITY]; + const createComment = !!featureCapabilities?.[CREATE_COMMENT_CAPABILITY]; const all = create && diff --git a/x-pack/plugins/cases/server/features.ts b/x-pack/plugins/cases/server/features.ts index 9d5519ac87c39..ddbb6488b64ec 100644 --- a/x-pack/plugins/cases/server/features.ts +++ b/x-pack/plugins/cases/server/features.ts @@ -16,7 +16,7 @@ import { APP_ID, FEATURE_ID, REOPEN_CASES_CAPABILITY, - COMMENT_CASES_CAPABILITY, + CREATE_COMMENT_CAPABILITY, } from '../common/constants'; import { createUICapabilities, getApiTags } from '../common'; @@ -144,7 +144,7 @@ export const getCasesKibanaFeature = (): KibanaFeatureConfig => { privileges: [ { api: apiTags.all, - id: COMMENT_CASES_CAPABILITY, + id: CREATE_COMMENT_CAPABILITY, name: i18n.translate('xpack.cases.features.addCommentsSubFeatureDetails', { defaultMessage: 'Add comments to cases', }), diff --git a/x-pack/plugins/features/common/feature_kibana_privileges.ts b/x-pack/plugins/features/common/feature_kibana_privileges.ts index 684a7b0bef2b1..7532c57e3d541 100644 --- a/x-pack/plugins/features/common/feature_kibana_privileges.ts +++ b/x-pack/plugins/features/common/feature_kibana_privileges.ts @@ -216,7 +216,25 @@ export interface FeatureKibanaPrivileges { * ``` */ settings?: readonly string[]; + /** + * List of case owners whose users should have createComment access when granted this privilege. + * @example + * ```ts + * { + * createComment: ['securitySolution'] + * } + * ``` + */ createComment?: readonly string[]; + /** + * List of case owners whose users should have reopenCases access when granted this privilege. + * @example + * ```ts + * { + * reopenCases: ['securitySolution'] + * } + * ``` + */ reopenCases?: readonly string[]; };