diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/plugins/security_solution/public/plugin.tsx index f7c35fbcb99f5..9833414b7a31f 100644 --- a/x-pack/plugins/security_solution/public/plugin.tsx +++ b/x-pack/plugins/security_solution/public/plugin.tsx @@ -17,7 +17,7 @@ import type { PluginInitializerContext, Plugin as IPlugin, } from '@kbn/core/public'; -import { DEFAULT_APP_CATEGORIES } from '@kbn/core/public'; +import { AppStatus, DEFAULT_APP_CATEGORIES } from '@kbn/core/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import type { TriggersAndActionsUIPublicPluginSetup } from '@kbn/triggers-actions-ui-plugin/public'; import { uiMetricService } from '@kbn/cloud-security-posture-common/utils/ui_metrics'; @@ -208,81 +208,8 @@ export class Plugin implements IPlugin { if (!this._subPlugins) { const { subPluginClasses } = await this.lazySubPlugins(); @@ -317,9 +249,6 @@ export class Plugin implements IPlugin ({ + status: AppStatus.inaccessible, + visibleIn: [], + })); + // no need to register the links updater when the plugin is inaccessible + return; + } + + // Configuration of AppLinks updater registration based on license and capabilities const { appLinks: initialAppLinks, getFilteredLinks, solutionAppLinksSwitcher, } = await this.lazyApplicationLinks(); - const { license$ } = plugins.licensing; - const { upsellingService, isSolutionNavigationEnabled$ } = this.contract; registerDeepLinksUpdater(this.appUpdater$, isSolutionNavigationEnabled$); - const appLinks$ = new Subject(); - appLinks$.next(initialAppLinks); + const appLinksToUpdate$ = new Subject(); + appLinksToUpdate$.next(initialAppLinks); - appLinks$ + appLinksToUpdate$ .pipe(combineLatestWith(license$, isSolutionNavigationEnabled$)) .subscribe(([appLinks, license, isSolutionNavigationEnabled]) => { const links = isSolutionNavigationEnabled ? solutionAppLinksSwitcher(appLinks) : appLinks; const linksPermissions: LinksPermissions = { experimentalFeatures: this.experimentalFeatures, upselling: upsellingService, - capabilities: core.application.capabilities, + capabilities, uiSettingsClient: core.uiSettings, ...(license.type != null && { license }), }; @@ -437,7 +379,82 @@ export class Plugin implements IPlugin