diff --git a/changelogs/fragments/7565.yml b/changelogs/fragments/7565.yml new file mode 100644 index 000000000000..4f3fbfdbe094 --- /dev/null +++ b/changelogs/fragments/7565.yml @@ -0,0 +1,2 @@ +fix: +- [Workspace]Add workspaces and permissions fields into saved objects _bulk_get response ([#7565](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7565)) \ No newline at end of file diff --git a/src/core/server/saved_objects/service/lib/included_fields.test.ts b/src/core/server/saved_objects/service/lib/included_fields.test.ts index 7993e83a443b..042c4b926942 100644 --- a/src/core/server/saved_objects/service/lib/included_fields.test.ts +++ b/src/core/server/saved_objects/service/lib/included_fields.test.ts @@ -30,7 +30,7 @@ import { includedFields } from './included_fields'; -const BASE_FIELD_COUNT = 9; +const BASE_FIELD_COUNT = 11; describe('includedFields', () => { it('returns undefined if fields are not provided', () => { @@ -56,6 +56,8 @@ Array [ "migrationVersion", "updated_at", "originId", + "workspaces", + "permissions", "foo", ] `); @@ -90,6 +92,8 @@ Array [ "migrationVersion", "updated_at", "originId", + "workspaces", + "permissions", "foo", "bar", ] diff --git a/src/core/server/saved_objects/service/lib/included_fields.ts b/src/core/server/saved_objects/service/lib/included_fields.ts index 561ba81c4eb7..265a23a33e8a 100644 --- a/src/core/server/saved_objects/service/lib/included_fields.ts +++ b/src/core/server/saved_objects/service/lib/included_fields.ts @@ -54,5 +54,7 @@ export function includedFields(type: string | string[] = '*', fields?: string[] .concat('migrationVersion') .concat('updated_at') .concat('originId') + .concat('workspaces') + .concat('permissions') .concat(fields); // v5 compatibility } diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index 0a85cd9be3ec..45852595e88b 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -2819,6 +2819,8 @@ describe('SavedObjectsRepository', () => { 'migrationVersion', 'updated_at', 'originId', + 'workspaces', + 'permissions', 'title', ], }),