Skip to content

Commit

Permalink
feat: call saved objects with internal user (opensearch-project#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <[email protected]>
  • Loading branch information
wanglam authored Aug 15, 2023
1 parent e4b45a9 commit 9393525
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/workspace/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
MANAGEMENT_WORKSPACE,
Permissions,
WorkspacePermissionMode,
SavedObjectsClient,
} from '../../../core/server';
import { IWorkspaceDBImpl, WorkspaceAttribute } from './types';
import { WorkspaceClientWithSavedObject } from './workspace_client';
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 9393525

Please sign in to comment.