Skip to content

Commit

Permalink
chore: update bulk create function
Browse files Browse the repository at this point in the history
Signed-off-by: tygao <tygao@amazon.com>
  • Loading branch information
raintygao committed Aug 2, 2023
1 parent ffbeaa1 commit b4a004f
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,10 @@ export class WorkspaceSavedObjectsClientWrapper {
options: SavedObjectsCreateOptions = {}
): Promise<SavedObjectsBulkResponse<T>> => {
if (options.workspaces) {
options.workspaces = options.workspaces.filter(
async (workspaceId) =>
await this.permissionControl.validate(
workspaceId,
WorkspacePermissionMode.Admin,
wrapperOptions.request
)
);
await this.validateMultiWorkspacesPermissions(options.workspaces, wrapperOptions.request, [
PermissionMode.Write,
PermissionMode.Management,
]);
}
return await wrapperOptions.client.bulkCreate(objects, options);
};
Expand Down

0 comments on commit b4a004f

Please sign in to comment.