diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts index d8b2616d3defb..59efbaf24d9e0 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/alert_types.ts @@ -132,7 +132,7 @@ async function alwaysFiringExecutor(alertExecutorOptions: any) { } } - await services.scopedClusterClient.index({ + await services.scopedClusterClient.asCurrentUser.index({ index: params.index, refresh: 'wait_for', body: { @@ -212,7 +212,7 @@ function getNeverFiringAlertType() { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', async executor({ services, params, state }) { - await services.scopedClusterClient.index({ + await services.scopedClusterClient.asCurrentUser.index({ index: params.index, refresh: 'wait_for', body: { @@ -252,7 +252,7 @@ function getFailingAlertType() { defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', async executor({ services, params, state }) { - await services.scopedClusterClient.index({ + await services.scopedClusterClient.asCurrentUser.index({ index: params.index, refresh: 'wait_for', body: { @@ -297,7 +297,7 @@ function getAuthorizationAlertType(core: CoreSetup) { let callClusterSuccess = false; let callClusterError; try { - await services.scopedClusterClient.index({ + await services.scopedClusterClient.asCurrentUser.index({ index: params.callClusterAuthorizationIndex, refresh: 'wait_for', body: { @@ -313,7 +313,7 @@ function getAuthorizationAlertType(core: CoreSetup) { let callScopedClusterSuccess = false; let callScopedClusterError; try { - await scopedClusterClient.index({ + await scopedClusterClient.asCurrentUser.index({ index: params.callClusterAuthorizationIndex, refresh: 'wait_for', body: { @@ -337,7 +337,7 @@ function getAuthorizationAlertType(core: CoreSetup) { savedObjectsClientError = e; } // Save the result - await services.scopedClusterClient.index({ + await services.scopedClusterClient.asCurrentUser.index({ index: params.index, refresh: 'wait_for', body: { @@ -416,7 +416,7 @@ function getPatternFiringAlertType() { } if (params.reference) { - await services.scopedClusterClient.index({ + await services.scopedClusterClient.asCurrentUser.index({ index: ES_TEST_INDEX_NAME, refresh: 'wait_for', body: {