@PreAuthorize("hasRole('RESOURCE_UPDATE')")
@RequestMapping(method = RequestMethod.POST, value = "/update")
public ResourceTO update(@RequestBody final ResourceTO resourceTO) {
LOG.debug("Role update request: {}", resourceTO);
ExternalResource resource = resourceDAO.find(resourceTO.getName());
if (resource == null) {
throw new NotFoundException("Resource '" + resourceTO.getName() + "'");
}
resource = binder.update(resource, resourceTO);
resource = resourceDAO.save(resource);
auditManager.audit(Category.resource, ResourceSubCategory.update, Result.success,
"Successfully updated resource: " + resource.getName());
return binder.getResourceTO(resource);
}