-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[ResponseOps][Alerting] Add the alerting v2 feature privileges #247452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| export const APP_ID = 'alerting_v2'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import type { FeaturesPluginSetup } from '@kbn/features-plugin/server'; | ||
| import type { AppCategory } from '@kbn/core/types'; | ||
| import { APP_ID } from '../constants'; | ||
|
|
||
| const ALERTS_FEATURE_ID = 'alerting_v2_alerts'; | ||
| const RULES_FEATURE_ID = 'alerting_v2_rules'; | ||
| const CATEGORY_ID = 'alerting'; | ||
|
|
||
| const getPrivileges = () => ({ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty for the moment until we have the SOs and APIs. |
||
| all: { | ||
| app: [APP_ID], | ||
| savedObject: { | ||
| all: [], | ||
| read: [], | ||
| }, | ||
| ui: [], | ||
| api: [], | ||
| }, | ||
| read: { | ||
| app: [APP_ID], | ||
| savedObject: { | ||
| all: [], | ||
| read: [], | ||
| }, | ||
| ui: [], | ||
| api: [], | ||
| }, | ||
| }); | ||
|
|
||
| const category: AppCategory = { | ||
| id: CATEGORY_ID, | ||
| label: 'Alerting', | ||
| order: 1000, | ||
| euiIconType: 'watchesApp', | ||
| }; | ||
|
Comment on lines
+37
to
+42
|
||
|
|
||
| const alertsFeature = { | ||
| id: ALERTS_FEATURE_ID, | ||
| name: 'Alerts', | ||
| category, | ||
| app: [APP_ID], | ||
| privileges: getPrivileges(), | ||
| }; | ||
|
|
||
| const rulesFeature = { | ||
| id: RULES_FEATURE_ID, | ||
| name: 'Rules', | ||
| category, | ||
| app: [APP_ID], | ||
| privileges: getPrivileges(), | ||
| }; | ||
|
|
||
| export const registerFeaturePrivileges = (features: FeaturesPluginSetup) => { | ||
| features.registerKibanaFeature(alertsFeature); | ||
| features.registerKibanaFeature(rulesFeature); | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import path uses '../constants' but the file is at '../lib/constants'. This will cause a module resolution error. Update the import to:
import { APP_ID } from './constants';since both files are in the samelibdirectory.