Skip to content

Commit

Permalink
[Reporting] Clarify deprecation changes of the roles settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Dec 15, 2021
1 parent 014d3dd commit 197fa77
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 29 deletions.
26 changes: 10 additions & 16 deletions x-pack/plugins/reporting/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,32 @@ export const config: PluginConfigDescriptor<ReportingConfigType> = {
configPath: `${fromPath}.roles.enabled`,
level: 'warning',
title: i18n.translate('xpack.reporting.deprecations.reportingRoles.title', {
defaultMessage: 'Setting "{fromPath}.roles" is deprecated',
defaultMessage: 'The [{fromPath}.roles] setting is deprecated',
values: { fromPath },
}),
// TODO: once scheduled reports is released, restate this to say that we have no access to scheduled reporting.
// https://github.com/elastic/kibana/issues/79905
message: i18n.translate('xpack.reporting.deprecations.reportingRoles.description', {
defaultMessage:
`Use Kibana application privileges to grant reporting privileges.` +
` Using "{fromPath}.roles.allow" to grant reporting privileges` +
` is deprecated.` +
` The "{fromPath}.roles.enabled" setting will default to false` +
` in a future release.`,
values: { fromPath },
`The default mechanism for Reporting privilege will work differently in future versions,` +
` which will affect the behavior of this cluster. Set [xpack.reporting.roles.enabled] to` +
` [false] to adopt the future behavior before upgrading.`,
}),
correctiveActions: {
manualSteps: [
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepOne', {
defaultMessage: `Set "xpack.reporting.roles.enabled" to "false" in kibana.yml.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepOnePartOne', {
defaultMessage: `Remove "xpack.reporting.roles.allow" to "false" in kibana.yml, if present.`,
defaultMessage: `Set [xpack.reporting.roles.enabled] to [false] in kibana.yml.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepTwo', {
defaultMessage: `Remove [xpack.reporting.roles.allow] in kibana.yml, if present.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepThree', {
defaultMessage:
`Create one or more roles that grant the Kibana application` +
` privilege for reporting from **Management > Security > Roles**.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepThree', {
defaultMessage:
`Grant reporting privileges to users by assigning one of the new roles.` +
` Users assigned a reporting role specified in "xpack.reporting.roles.allow"` +
` will no longer have reporting privileges, they must be assigned an application privilege based role.`,
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepFour', {
defaultMessage: `Grant reporting privileges to users by assigning one of the new roles.`,
}),
],
},
Expand Down
42 changes: 29 additions & 13 deletions x-pack/plugins/reporting/server/deprecations/reporting_role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,39 @@ async function getUsersDeprecations(
): Promise<DeprecationsDetails[]> {
const usingDeprecatedConfig = !reportingCore.getContract().usesUiCapabilities();
const strings = {
title: i18n.translate('xpack.reporting.deprecations.reportingRoleUsersTitle', {
title: i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.title', {
defaultMessage: 'The "{reportingUserRoleName}" role is deprecated: check user roles',
values: { reportingUserRoleName: REPORTING_USER_ROLE_NAME },
}),
message: i18n.translate('xpack.reporting.deprecations.reportingRoleUsersMessage', {
message: i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.description', {
defaultMessage:
'Existing users have their Reporting privilege granted by a deprecated setting.',
`The default mechanism for Reporting privilege will work differently in future versions, and` +
` this cluster contains users who have a deprecated role for this privilege.` +
` Set [xpack.reporting.roles.enabled] to [false] to adopt the future behavior before upgrading.`,
}),
manualSteps: (usersRoles: string) => [
...(usingDeprecatedConfig
? [
i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.manualStepOne', {
defaultMessage: 'Set "xpack.reporting.roles.enabled: false" in kibana.yml.',
defaultMessage: 'Set [xpack.reporting.roles.enabled] to [false] in kibana.yml.',
}),
i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.manualStepTwo', {
defaultMessage: 'Remove "xpack.reporting.roles.allow" in kibana.yml, if present.',
defaultMessage: 'Remove [xpack.reporting.roles.allow] in kibana.yml, if present.',
}),
]
: []),

i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.manualStepThree', {
defaultMessage: 'Create a custom role with Kibana privileges to grant access to Reporting.',
defaultMessage:
`Create one or more roles that grant the Kibana application` +
` privilege for reporting from **Management > Security > Roles**.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.manualStepFour', {
defaultMessage: `Grant reporting privileges to users by assigning one of the new roles.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoleUsers.manualStepFive', {
defaultMessage:
'Remove the "reporting_user" role from all users and add the custom role. The affected users are: {usersRoles}.',
'Remove the "reporting_user" role from all users and add the custom role. The affected users are: [{usersRoles}].',
values: { usersRoles },
}),
],
Expand Down Expand Up @@ -136,18 +143,21 @@ async function getRoleMappingsDeprecations(
): Promise<DeprecationsDetails[]> {
const usingDeprecatedConfig = !reportingCore.getContract().usesUiCapabilities();
const strings = {
title: i18n.translate('xpack.reporting.deprecations.reportingRoleMappingsTitle', {
title: i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.title', {
defaultMessage: 'The "{reportingUserRoleName}" role is deprecated: check role mappings',
values: { reportingUserRoleName: REPORTING_USER_ROLE_NAME },
}),
message: i18n.translate('xpack.reporting.deprecations.reportingRoleMappingsMessage', {
defaultMessage: 'Existing roles are mapped to a deprecated role for Reporting privileges',
message: i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.description', {
defaultMessage:
`The default mechanism for Reporting privilege will work differently in future versions, and` +
` this cluster contains role mappings that are mapped to a deprecated role for this privilege.` +
` Set [xpack.reporting.roles.enabled] to [false] to adopt the future behavior before upgrading.`,
}),
manualSteps: (roleMappings: string) => [
...(usingDeprecatedConfig
? [
i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.manualStepOne', {
defaultMessage: 'Set "xpack.reporting.roles.enabled: false" in kibana.yml.',
defaultMessage: `Set [xpack.reporting.roles.enabled] to [false] in kibana.yml.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.manualStepTwo', {
defaultMessage: 'Remove "xpack.reporting.roles.allow" in kibana.yml, if present.',
Expand All @@ -156,11 +166,17 @@ async function getRoleMappingsDeprecations(
: []),

i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.manualStepThree', {
defaultMessage: 'Create a custom role with Kibana privileges to grant access to Reporting.',
defaultMessage:
`Create one or more roles that grant the Kibana application` +
` privilege for reporting from **Management > Security > Roles**.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.manualStepFour', {
defaultMessage: `Grant reporting privileges to users by assigning one of the new roles.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoleMappings.manualStepFive', {
defaultMessage:
'Remove the "reporting_user" role from all role mappings and add the custom role. The affected role mappings are: {roleMappings}.',
'Remove the "reporting_user" role from all role mappings and add the custom role.' +
' The affected role mappings are: {roleMappings}.',
values: { roleMappings },
}),
],
Expand Down

0 comments on commit 197fa77

Please sign in to comment.