diff --git a/x-pack/plugins/ml/server/lib/capabilities/check_capabilities.ts b/x-pack/plugins/ml/server/lib/capabilities/check_capabilities.ts index 9b877aea46e0b..36586241782e4 100644 --- a/x-pack/plugins/ml/server/lib/capabilities/check_capabilities.ts +++ b/x-pack/plugins/ml/server/lib/capabilities/check_capabilities.ts @@ -50,10 +50,10 @@ function disableAdminPrivileges(capabilities: MlCapabilities) { capabilities.canDeleteAnnotation = false; } -export type HasMlCapabilities = (capabilities: MlCapabilitiesKey[]) => void; +export type HasMlCapabilities = (capabilities: MlCapabilitiesKey[]) => Promise; export function hasMlCapabilitiesProvider(resolveMlCapabilities: ResolveMlCapabilities) { - return (request: KibanaRequest) => { + return (request: KibanaRequest): HasMlCapabilities => { return async (capabilities: MlCapabilitiesKey[]) => { const mlCapabilities = await resolveMlCapabilities(request); if (mlCapabilities === null) {