@RequestMapping(value = "/applications/{applicationId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('ADMIN')")
@Audit
public synchronized RestResponse<Void> revokeApplicationAccess(@PathVariable String orchestratorId, @PathVariable String locationId,
@PathVariable String applicationId, @PathVariable String resourceId) {
<BUG>LocationResourceTemplate resourceTemplate = locationResourceService.getOrFail(resourceId);
hasAuthorizationOrFailed(resourceTemplate, Subject.APPLICATION, new String[] { applicationId });

resourcePermissionService.revokePermission(resourceTemplate, Subject.APPLICATION, applicationId);</BUG>
ApplicationEnvironment[] aes = applicationEnvironmentService.getByApplicationId(applicationId);

@RequestMapping(value = "/applications/{applicationId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('ADMIN')")
@Audit
public synchronized RestResponse<Void> revokeApplicationAccess(@PathVariable String orchestratorId, @PathVariable String locationId,
@PathVariable String applicationId, @PathVariable String resourceId) {
Location location = locationService.getLocation(orchestratorId, locationId);
hasAuthorizationOrFailed(location, Subject.APPLICATION, new String[] { applicationId });
LocationResourceTemplate resourceTemplate = locationResourceService.getOrFail(resourceId);
resourcePermissionService.revokePermission(resourceTemplate, Subject.APPLICATION, applicationId);
ApplicationEnvironment[] aes = applicationEnvironmentService.getByApplicationId(applicationId);
