From b72bebf6e57480780ce3ef975f435f210e60321d Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Tue, 13 Jul 2021 13:42:58 +0200 Subject: [PATCH] do not check for privileges if security is disbaled --- x-pack/plugins/reporting/server/routes/deprecations.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/plugins/reporting/server/routes/deprecations.ts b/x-pack/plugins/reporting/server/routes/deprecations.ts index 1cb5b11319ff91..0daa56274cc00a 100644 --- a/x-pack/plugins/reporting/server/routes/deprecations.ts +++ b/x-pack/plugins/reporting/server/routes/deprecations.ts @@ -21,6 +21,11 @@ export const registerDeprecationsRoutes = (reporting: ReportingCore, logger: Log const authzWrapper = (handler: RequestHandler): RequestHandler => { return async (ctx, req, res) => { + const { security } = reporting.getPluginSetupDeps(); + if (!security) { + return handler(ctx, req, res); + } + const { core: { elasticsearch }, } = ctx;