Skip to content

Commit

Permalink
feat: call saved objects with internal user (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <wonglam@amazon.com>
  • Loading branch information
wanglam authored and SuZhou-Joe committed Aug 31, 2023
1 parent 90ac9f3 commit 8766c80
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 8766c80

Please sign in to comment.