-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Moving to kibana capabilities (#64057)
* [ML] Moving to kibana capabilities * fixing types * renaming privilges * renaming privileges to capabilities * renaming resolvers * correcting admin capabilities * fixing includes * removing any types * renaming type * readding spaces * adding capabilities switcher * updating comment * removing unnecessary failing tests * adding error to log
- Loading branch information
1 parent
6bb7515
commit b3c7002
Showing
68 changed files
with
690 additions
and
1,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { KibanaRequest } from 'kibana/server'; | ||
|
||
export const userMlCapabilities = { | ||
// Anomaly Detection | ||
canGetJobs: false, | ||
canGetDatafeeds: false, | ||
// Calendars | ||
canGetCalendars: false, | ||
// File Data Visualizer | ||
canFindFileStructure: false, | ||
// Filters | ||
canGetFilters: false, | ||
// Data Frame Analytics | ||
canGetDataFrameAnalytics: false, | ||
}; | ||
|
||
export const adminMlCapabilities = { | ||
// Anomaly Detection | ||
canCreateJob: false, | ||
canDeleteJob: false, | ||
canOpenJob: false, | ||
canCloseJob: false, | ||
canForecastJob: false, | ||
canStartStopDatafeed: false, | ||
canUpdateJob: false, | ||
canUpdateDatafeed: false, | ||
canPreviewDatafeed: false, | ||
// Calendars | ||
canCreateCalendar: false, | ||
canDeleteCalendar: false, | ||
// Filters | ||
canCreateFilter: false, | ||
canDeleteFilter: false, | ||
// Data Frame Analytics | ||
canDeleteDataFrameAnalytics: false, | ||
canCreateDataFrameAnalytics: false, | ||
canStartStopDataFrameAnalytics: false, | ||
}; | ||
|
||
export type UserMlCapabilities = typeof userMlCapabilities; | ||
export type AdminMlCapabilities = typeof adminMlCapabilities; | ||
export type MlCapabilities = UserMlCapabilities & AdminMlCapabilities; | ||
|
||
export const basicLicenseMlCapabilities = ['canFindFileStructure'] as Array<keyof MlCapabilities>; | ||
|
||
export function getDefaultCapabilities(): MlCapabilities { | ||
return { | ||
...userMlCapabilities, | ||
...adminMlCapabilities, | ||
}; | ||
} | ||
|
||
export interface MlCapabilitiesResponse { | ||
capabilities: MlCapabilities; | ||
upgradeInProgress: boolean; | ||
isPlatinumOrTrialLicense: boolean; | ||
mlFeatureEnabledInSpace: boolean; | ||
} | ||
|
||
export type ResolveMlCapabilities = (request: KibanaRequest) => Promise<MlCapabilities | null>; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.