// TODO check and ensure user is Moderator role
@RequestMapping(path = "/0/admin/applications/{appId}/block", method = RequestMethod.POST)
	public ResponseEntity<Boolean> updateDeveloperApplication(
			@PathVariable String appId
	) {
		// Let's get the user from principal and validate the userId against it.
		User user = userService.findAuthenticatedUser();
		if (user == null)
			return new ResponseEntity<>(HttpStatus.FORBIDDEN);
		// TODO check and ensure user is Moderator role
		Application application = applicationService.findApplication(appId);
		if (application == null){
			logger.debug("Application not found pre condition failed");
			return new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED);
		}	
		// TODO what if Application was already blocked?
		Boolean result = applicationService.blockApplication(application);
		return new ResponseEntity<>(result, HttpStatus.OK);
	}
if (user == null)
return new ResponseEntity<>(HttpStatus.FORBIDDEN);
// TODO check and ensure user is Moderator role
Application application = applicationService.findApplication(appId);
if (application == null){
@RequestMapping(path = "/0/admin/applications/{appId}/block", method = RequestMethod.POST)
public ResponseEntity<Boolean> updateDeveloperApplication(
@PathVariable String appId
) {
// Let's get the user from principal and validate the userId against it.
User user = userService.findAuthenticatedUser();
if (user == null)
return new ResponseEntity<>(HttpStatus.FORBIDDEN);
// TODO check and ensure user is Moderator role
Application application = applicationService.findApplication(appId);
if (application == null){
logger.debug("Application not found pre condition failed");
return new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED);
}
// TODO what if Application was already blocked?
Boolean result = applicationService.blockApplication(application);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@RequestMapping(path = "/0/admin/applications/{appId}/block", method = RequestMethod.POST)
public ResponseEntity<Boolean> updateDeveloperApplication(
@PathVariable String appId
) {
// Let's get the user from principal and validate the userId against it.
User user = userService.findAuthenticatedUser();
if (user == null)
return new ResponseEntity<>(HttpStatus.FORBIDDEN);
// TODO check and ensure user is Moderator role
Application application = applicationService.findApplication(appId);
if (application == null){
logger.debug("Application not found pre condition failed");
return new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED);
}
// TODO what if Application was already blocked?
Boolean result = applicationService.blockApplication(application);
return new ResponseEntity<>(result, HttpStatus.OK);
}