Skip to content
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

[Alerting] add alerting privileges for uptime and metrics #61113

Merged
merged 3 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions x-pack/plugins/infra/server/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,40 @@ export const METRICS_FEATURE = {
all: {
app: ['infra', 'kibana'],
catalogue: ['infraops'],
api: ['infra'],
api: ['infra', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: ['infrastructure-ui-source'],
all: ['infrastructure-ui-source', 'alert', 'action', 'action_task_params'],
read: ['index-pattern'],
},
ui: ['show', 'configureSource', 'save'],
ui: [
'show',
'configureSource',
'save',
'alerting:show',
'actions:show',
'alerting:save',
'actions:save',
'alerting:delete',
'actions:delete',
],
},
read: {
app: ['infra', 'kibana'],
catalogue: ['infraops'],
api: ['infra'],
api: ['infra', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: [],
all: ['alert', 'action', 'action_task_params'],
read: ['infrastructure-ui-source', 'index-pattern'],
},
ui: ['show'],
ui: [
'show',
'alerting:show',
'actions:show',
'alerting:save',
'actions:save',
'alerting:delete',
'actions:delete',
],
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

type Capabilities = Record<string, any>;

const apps = ['apm', 'siem'];
const apps = ['apm', 'siem', 'uptime', 'infrastructure'];

function hasCapability(capabilities: Capabilities, capability: string) {
return apps.some(app => capabilities[app]?.[capability]);
Expand Down
37 changes: 31 additions & 6 deletions x-pack/plugins/uptime/server/kibana.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,47 @@ export const initServerWithKibana = (server: UptimeCoreSetup, plugins: UptimeCor
all: {
app: ['uptime', 'kibana'],
catalogue: ['uptime'],
api: ['uptime-read', 'uptime-write'],
api: [
'uptime-read',
'uptime-write',
'actions-read',
'actions-all',
'alerting-read',
'alerting-all',
],
savedObject: {
all: [umDynamicSettings.name],
all: [umDynamicSettings.name, 'alert', 'action', 'action_task_params'],
read: [],
},
ui: ['save', 'configureSettings', 'show'],
ui: [
'save',
'configureSettings',
'show',
'alerting:show',
'actions:show',
'alerting:save',
'actions:save',
'alerting:delete',
'actions:delete',
],
},
read: {
app: ['uptime', 'kibana'],
catalogue: ['uptime'],
api: ['uptime-read'],
api: ['uptime-read', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: [],
all: ['alert', 'action', 'action_task_params'],
read: [umDynamicSettings.name],
},
ui: ['show'],
ui: [
'show',
'alerting:show',
'actions:show',
'alerting:save',
'actions:save',
'alerting:delete',
'actions:delete',
],
},
},
});
Expand Down