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

Cleanup alerting / actions feature controls #52286

Merged
merged 11 commits into from
Dec 13, 2019
46 changes: 23 additions & 23 deletions x-pack/legacy/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,29 @@ export class Plugin {
this.adminClient = await core.elasticsearch.adminClient$.pipe(first()).toPromise();
this.defaultKibanaIndex = (await this.kibana$.pipe(first()).toPromise()).index;

plugins.xpack_main.registerFeature({
id: 'actions',
name: 'Actions',
app: ['actions', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['action', 'action_task_params'],
read: [],
},
ui: [],
api: ['actions-read', 'actions-all'],
},
read: {
savedObject: {
all: ['action_task_params'],
read: ['action'],
},
ui: [],
api: ['actions-read'],
},
},
});
// plugins.xpack_main.registerFeature({
// id: 'actions',
// name: 'Actions',
// app: ['actions', 'kibana'],
// privileges: {
// all: {
// savedObject: {
// all: ['action', 'action_task_params'],
// read: [],
// },
// ui: [],
// api: ['actions-read', 'actions-all'],
// },
// read: {
// savedObject: {
// all: ['action_task_params'],
// read: ['action'],
// },
// ui: [],
// api: ['actions-read'],
// },
// },
// });

// Encrypted attributes
// - `secrets` properties will be encrypted
Expand Down
46 changes: 23 additions & 23 deletions x-pack/legacy/plugins/alerting/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,29 @@ export class Plugin {
): Promise<PluginSetupContract> {
this.adminClient = await core.elasticsearch.adminClient$.pipe(first()).toPromise();

plugins.xpack_main.registerFeature({
id: 'alerting',
name: 'Alerting',
app: ['alerting', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['alert'],
read: [],
},
ui: [],
api: ['alerting-read', 'alerting-all'],
},
read: {
savedObject: {
all: [],
read: ['alert'],
},
ui: [],
api: ['alerting-read'],
},
},
});
// plugins.xpack_main.registerFeature({
// id: 'alerting',
// name: 'Alerting',
// app: ['alerting', 'kibana'],
// privileges: {
// all: {
// savedObject: {
// all: ['alert'],
// read: [],
// },
// ui: [],
// api: ['alerting-read', 'alerting-all'],
// },
// read: {
// savedObject: {
// all: [],
// read: ['alert'],
// },
// ui: [],
// api: ['alerting-read'],
// },
// },
// });

// Encrypted attributes
plugins.encryptedSavedObjects.registerType({
Expand Down
6 changes: 5 additions & 1 deletion x-pack/legacy/plugins/monitoring/server/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export class Plugin {
reserved: {
privilege: {
mikecote marked this conversation as resolved.
Show resolved Hide resolved
savedObject: {
all: [],
all: [
'alert',
'action',
'action_task_params',
],
read: []
},
ui: [],
mikecote marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
9 changes: 8 additions & 1 deletion x-pack/legacy/plugins/siem/server/kibana.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ export const initServerWithKibana = (
all: {
api: ['siem'],
savedObject: {
all: [noteSavedObjectType, pinnedEventSavedObjectType, timelineSavedObjectType],
all: [
'alert',
'action',
'action_task_params',
noteSavedObjectType,
pinnedEventSavedObjectType,
timelineSavedObjectType,
],
read: ['config'],
mikecote marked this conversation as resolved.
Show resolved Hide resolved
},
ui: ['show'],
mikecote marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ export default function(kibana: any) {
require: ['actions'],
name: NAME,
init: (server: Hapi.Server) => {
server.plugins.xpack_main.registerFeature({
id: 'actions',
name: 'Actions',
app: ['actions', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['action', 'action_task_params'],
read: [],
},
ui: [],
api: ['actions-read', 'actions-all'],
},
read: {
savedObject: {
all: ['action_task_params'],
read: ['action'],
},
ui: [],
api: ['actions-read'],
},
},
});

initSlack(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.SLACK));
initWebhook(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.WEBHOOK));
initPagerduty(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.PAGERDUTY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ export default function(kibana: any) {
require: ['actions', 'alerting', 'elasticsearch'],
name: 'alerts',
init(server: any) {
server.plugins.xpack_main.registerFeature({
id: 'alerting',
name: 'Alerting',
app: ['alerting', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['alert'],
read: [],
},
ui: [],
api: ['alerting-read', 'alerting-all'],
},
read: {
savedObject: {
all: [],
read: ['alert'],
},
ui: [],
api: ['alerting-read'],
},
},
});

// Action types
const noopActionType: ActionType = {
id: 'test.noop',
Expand Down