-
Notifications
You must be signed in to change notification settings - Fork 8.1k
/
actions.ts
46 lines (42 loc) · 1.73 KB
/
actions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* 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 { AlertingActions } from './alerting';
import { ApiActions } from './api';
import { AppActions } from './app';
import { CasesActions } from './cases';
import { SavedObjectActions } from './saved_object';
import { SpaceActions } from './space';
import { UIActions } from './ui';
/** Actions are used to create the "actions" that are associated with Elasticsearch's
* application privileges, and are used to perform the authorization checks implemented
* by the various `checkPrivilegesWithRequest` derivatives.
*/
export class Actions {
public readonly api: ApiActions;
public readonly app: AppActions;
public readonly cases: CasesActions;
public readonly login: string;
public readonly savedObject: SavedObjectActions;
public readonly alerting: AlertingActions;
public readonly space: SpaceActions;
public readonly ui: UIActions;
public readonly version: string;
constructor(private readonly versionNumber: string) {
if (versionNumber === '') {
throw new Error(`version can't be an empty string`);
}
this.api = new ApiActions(this.versionNumber);
this.app = new AppActions(this.versionNumber);
this.cases = new CasesActions(this.versionNumber);
this.login = 'login:';
this.savedObject = new SavedObjectActions(this.versionNumber);
this.alerting = new AlertingActions(this.versionNumber);
this.space = new SpaceActions(this.versionNumber);
this.ui = new UIActions(this.versionNumber);
this.version = `version:${this.versionNumber}`;
}
}