fix(slo): Add slo-settings saved object to the slo feature registration (#182509)

## Summary

This PR register the slo settings saved object with the slo feature.

**How to test**
1. Create some SLOs with an admin account
1. Setup a new role with a **read** access to the Observability > SLO
feature, and the `*` index -> `read`
2. Setup a new user with that role
3. Go to the SLO page
4. Notice /api/observability/slo/settings and /api/observability/slos
api are failing with Forbidden: `Unable to get slo-settings`
5. Checkout this branch
6. Errors should be gone.
This commit is contained in:
Kevin Delemme 2024-05-03 04:41:47 -04:00 committed by GitHub
parent 79b4d5e963
commit 0291c8195a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,7 @@ import { registerBurnRateRule } from './lib/rules/register_burn_rate_rule';
import { SloConfig } from '.';
import { registerRoutes } from './routes/register_routes';
import { getSloServerRouteRepository } from './routes/get_slo_server_route_repository';
import { sloSettings } from './saved_objects/slo_settings';
import { sloSettings, SO_SLO_SETTINGS_TYPE } from './saved_objects/slo_settings';
export type SloPluginSetup = ReturnType<SloPlugin['setup']>;
@ -73,7 +73,7 @@ export class SloPlugin implements Plugin<SloPluginSetup> {
const config = this.initContext.config.get<SloConfig>();
const alertsLocator = plugins.share.url.locators.create(new AlertsLocatorDefinition());
const savedObjectTypes = [SO_SLO_TYPE];
const savedObjectTypes = [SO_SLO_TYPE, SO_SLO_SETTINGS_TYPE];
plugins.features.registerKibanaFeature({
id: sloFeatureId,