private void preparePersistenceAccess() {
if (authenticationContext.getAuthenticatedPrincipal() == null
|| !(authenticationContext.getAuthenticatedPrincipal() instanceof String)) {
throw new AuthenticationException("A user with DB access must be logged in.");
}
currentContext = ContextHolder.get().getCurrentContextId();
ContextHolder.get().setCurrentContextId("up-context");
}