if (mimeType == null)
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
// Set owner and date created
User user = securityService.getUser();
if (user == null)
throw new WebApplicationException(Status.UNAUTHORIZED);
// Make sure the user has editing rights
if (!SecurityUtils.userHasRole(user, SystemRole.EDITOR))