Skip to content

Commit

Permalink
throw endpoint context not started error
Browse files Browse the repository at this point in the history
  • Loading branch information
semd committed Feb 5, 2024
1 parent 78b153c commit 0bfd1f4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ export class EndpointAppContextService {
}

public async getEndpointAuthz(request: KibanaRequest): Promise<EndpointAuthz> {
if (!this.startDependencies?.appFeaturesService) {
throw new EndpointAppContentServicesNotStartedError();
}
const fleetAuthz = await this.getFleetAuthzService().fromRequest(request);
const userRoles = this.security?.authc.getCurrentUser(request)?.roles ?? [];
return calculateEndpointAuthz(
this.getLicenseService(),
fleetAuthz,
userRoles,
this.startDependencies?.appFeaturesService
this.startDependencies.appFeaturesService
);
}

Expand Down

0 comments on commit 0bfd1f4

Please sign in to comment.