[Synthetics] Enable isAllowed by default on premises (#138820) (#138831)

(cherry picked from commit 71c4e74c8e)

Co-authored-by: Shahzad <shahzad.muhammad@elastic.co>
This commit is contained in:
Kibana Machine 2022-08-15 12:42:05 -04:00 committed by GitHub
parent 808ae20348
commit ed6abc24fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,9 +12,11 @@ export const getServiceAllowedRoute: SyntheticsRestApiRouteFactory = () => ({
method: 'GET',
path: API_URLS.SERVICE_ALLOWED,
validate: {},
handler: async ({ syntheticsMonitorClient }): Promise<any> => {
handler: async ({ syntheticsMonitorClient, server }): Promise<any> => {
const isCloud = Boolean(server.cloud?.isCloudEnabled);
return {
serviceAllowed: syntheticsMonitorClient.syntheticsService.isAllowed,
serviceAllowed: isCloud ? syntheticsMonitorClient.syntheticsService.isAllowed : true,
signupUrl: syntheticsMonitorClient.syntheticsService.signupUrl,
};
},