From 62b191c0dd65e992e08181961fb8b64614432daa Mon Sep 17 00:00:00 2001 From: jennypavlova Date: Fri, 22 Nov 2024 18:40:27 +0100 Subject: [PATCH] [Profiling UI] Fix deprecated usage of ApiActions `get` (#200883) Closes #200708 ## Summary This PR fixes deprecated usage of ApiActions get in [get_has_setup_privileges.ts](https://github.com/elastic/kibana/compare/main...jennypavlova:200708-profiling-ui-fix-deprecated-usage-of-apiactions-get?expand=1#diff-3ed5ba625d0b40a258485edf84456c4258de4ea21727ec342a440238a534bc97) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../server/lib/setup/get_has_setup_privileges.ts | 8 ++++++-- .../observability_solution/profiling/tsconfig.json | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/observability_solution/profiling/server/lib/setup/get_has_setup_privileges.ts b/x-pack/plugins/observability_solution/profiling/server/lib/setup/get_has_setup_privileges.ts index 83bd21b1740b8..8696c97dabd31 100644 --- a/x-pack/plugins/observability_solution/profiling/server/lib/setup/get_has_setup_privileges.ts +++ b/x-pack/plugins/observability_solution/profiling/server/lib/setup/get_has_setup_privileges.ts @@ -7,6 +7,7 @@ import { KibanaRequest } from '@kbn/core/server'; import { INTEGRATIONS_PLUGIN_ID, PLUGIN_ID as FLEET_PLUGIN_ID } from '@kbn/fleet-plugin/common'; +import { ApiOperation } from '@kbn/security-plugin-types-server'; import { ProfilingPluginStartDeps } from '../../types'; export async function getHasSetupPrivileges({ @@ -31,8 +32,11 @@ export async function getHasSetupPrivileges({ }, }, kibana: [ - securityPluginStart.authz.actions.api.get(`${FLEET_PLUGIN_ID}-all`), - securityPluginStart.authz.actions.api.get(`${INTEGRATIONS_PLUGIN_ID}-all`), + securityPluginStart.authz.actions.api.get(ApiOperation.Manage, `${FLEET_PLUGIN_ID}-all`), + securityPluginStart.authz.actions.api.get( + ApiOperation.Manage, + `${INTEGRATIONS_PLUGIN_ID}-all` + ), ], }); return hasAllRequested; diff --git a/x-pack/plugins/observability_solution/profiling/tsconfig.json b/x-pack/plugins/observability_solution/profiling/tsconfig.json index 937eee96641c8..b89d34bb8442b 100644 --- a/x-pack/plugins/observability_solution/profiling/tsconfig.json +++ b/x-pack/plugins/observability_solution/profiling/tsconfig.json @@ -54,7 +54,8 @@ "@kbn/management-settings-components-field-row", "@kbn/deeplinks-observability", "@kbn/react-kibana-context-render", - "@kbn/apm-data-access-plugin" + "@kbn/apm-data-access-plugin", + "@kbn/security-plugin-types-server" // add references to other TypeScript projects the plugin depends on // requiredPlugins from ./kibana.json