From d84ac13a4abd5de1f97aede2843b7c62745d191b Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Thu, 29 Oct 2020 14:04:37 -0400 Subject: [PATCH] [Logs App] Fix logs permissions for alert management (#81199) * 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> --- 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 d49755b6f68c..c768cae247a9 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 de6353d6b045..78edbafa4ae4 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', () => {