public void importEntity(@RequestParam("file") MultipartFile entityFile,
HttpServletRequest request, HttpServletResponse response) throws IOException, XMLStreamException {
//Get a StAX reader for the source to determine info about the data to import
final BufferedXMLEventReader bufferedXmlEventReader = createSourceXmlEventReader(entityFile);
final PortalDataKey portalDataKey = getPortalDataKey(bufferedXmlEventReader);
final IPerson person = personManager.getPerson(request);
final EntityIdentifier ei = person.getEntityIdentifier();
final IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
if (!ap.hasPermission("UP_SYSTEM", "IMPORT_ENTITY", portalDataKey.getName().getLocalPart())) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
portalDataHandlerService.importData(new StAXSource(bufferedXmlEventReader));