From 68e85c41ef83043cc4b00d078624e67b7959b3b4 Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Thu, 29 Oct 2020 15:52:31 -0400 Subject: [PATCH] [Logs App] Fix logs permissions for alert management (#81199) (#82053) * Mimics metrics permissions for alert mgmt in logs feature * Updates logs security functional tests Alert management permissions were added for read and all logs users in this PR, so both of these users now have "Stack Management" appear in the nav. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/infra/server/features.ts | 9 +++++++++ .../apps/infra/feature_controls/logs_security.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/infra/server/features.ts b/x-pack/plugins/infra/server/features.ts index d49755b6f68c1..c768cae247a99 100644 --- a/x-pack/plugins/infra/server/features.ts +++ b/x-pack/plugins/infra/server/features.ts @@ -68,6 +68,9 @@ export const LOGS_FEATURE = { category: DEFAULT_APP_CATEGORIES.observability, app: ['infra', 'logs', 'kibana'], catalogue: ['infralogging', 'logs'], + management: { + insightsAndAlerting: ['triggersActions'], + }, alerting: [LOG_DOCUMENT_COUNT_ALERT_TYPE_ID], privileges: { all: { @@ -81,6 +84,9 @@ export const LOGS_FEATURE = { alerting: { all: [LOG_DOCUMENT_COUNT_ALERT_TYPE_ID], }, + management: { + insightsAndAlerting: ['triggersActions'], + }, ui: ['show', 'configureSource', 'save'], }, read: { @@ -90,6 +96,9 @@ export const LOGS_FEATURE = { alerting: { read: [LOG_DOCUMENT_COUNT_ALERT_TYPE_ID], }, + management: { + insightsAndAlerting: ['triggersActions'], + }, savedObject: { all: [], read: ['infrastructure-ui-source'], diff --git a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts index b938174892e9e..bdd0c37996874 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts @@ -58,7 +58,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows logs navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Logs']); + expect(navLinks).to.eql(['Overview', 'Logs', 'Stack Management']); }); describe('logs landing page without data', () => { @@ -121,7 +121,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows logs navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Logs']); + expect(navLinks).to.eql(['Overview', 'Logs', 'Stack Management']); }); describe('logs landing page without data', () => {