From 9393525acca195c793598d67fe375b3a537ac75b Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Tue, 15 Aug 2023 10:34:34 +0800 Subject: [PATCH] feat: call saved objects with internal user (#80) Signed-off-by: Lin Wang --- src/plugins/workspace/server/plugin.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/workspace/server/plugin.ts b/src/plugins/workspace/server/plugin.ts index 1189af540d88..710eaeea1819 100644 --- a/src/plugins/workspace/server/plugin.ts +++ b/src/plugins/workspace/server/plugin.ts @@ -17,6 +17,7 @@ import { MANAGEMENT_WORKSPACE, Permissions, WorkspacePermissionMode, + SavedObjectsClient, } from '../../../core/server'; import { IWorkspaceDBImpl, WorkspaceAttribute } from './types'; import { WorkspaceClientWithSavedObject } from './workspace_client'; @@ -72,6 +73,10 @@ export class WorkspacePlugin implements Plugin<{}, {}> { client: this.client as IWorkspaceDBImpl, }); + core.savedObjects.setClientFactoryProvider((repositoryFactory) => () => + new SavedObjectsClient(repositoryFactory.createInternalRepository()) + ); + return { client: this.client, };