diff --git a/x-pack/legacy/plugins/infra/public/utils/use_kibana_space_id.ts b/x-pack/legacy/plugins/infra/public/utils/use_kibana_space_id.ts
index 4642f7fd26f21..52c896feef1a2 100644
--- a/x-pack/legacy/plugins/infra/public/utils/use_kibana_space_id.ts
+++ b/x-pack/legacy/plugins/infra/public/utils/use_kibana_space_id.ts
@@ -11,6 +11,7 @@ import * as rt from 'io-ts';
import { useKibanaInjectedVar } from './use_kibana_injected_var';
export const useKibanaSpaceId = (): string => {
+ // NOTICE: use of `activeSpace` is deprecated and will not be made available in the New Platform.
const activeSpace = useKibanaInjectedVar('activeSpace');
return pipe(
diff --git a/x-pack/legacy/plugins/security/public/views/management/edit_role/index.js b/x-pack/legacy/plugins/security/public/views/management/edit_role/index.js
index 8b54f50c4beeb..09c612526918f 100644
--- a/x-pack/legacy/plugins/security/public/views/management/edit_role/index.js
+++ b/x-pack/legacy/plugins/security/public/views/management/edit_role/index.js
@@ -15,7 +15,6 @@ import 'plugins/security/services/shield_user';
import 'plugins/security/services/shield_role';
import 'plugins/security/services/shield_indices';
import { xpackInfo } from 'plugins/xpack_main/services/xpack_info';
-import { SpacesManager } from '../../../../../spaces/public/lib';
import { ROLES_PATH, CLONE_ROLES_PATH, EDIT_ROLES_PATH } from '../management_urls';
import { getEditRoleBreadcrumbs, getCreateRoleBreadcrumbs } from '../breadcrumbs';
@@ -79,7 +78,7 @@ const routeDefinition = action => ({
},
spaces(spacesEnabled) {
if (spacesEnabled) {
- return new SpacesManager().getSpaces();
+ return kfetch({ method: 'get', pathname: '/api/spaces/space' });
}
return [];
},
diff --git a/x-pack/legacy/plugins/spaces/index.ts b/x-pack/legacy/plugins/spaces/index.ts
index b20ddacc7e527..0083847cfb441 100644
--- a/x-pack/legacy/plugins/spaces/index.ts
+++ b/x-pack/legacy/plugins/spaces/index.ts
@@ -48,7 +48,6 @@ export const spaces = (kibana: Record