String user = WGDatabase.ANONYMOUS_USER;
String pwd = null;
if (_crossLoginMode.equals(WGAXML.DESIGNSHARING_MODE_PARALLEL)) {
if (!sourceDB.isSessionOpen()) {
throw new WGAuthorisationException("Unable to do cross login in parallel mode while both databases have no session open");
}
if (sourceDB.getSessionContext().isMasterSession()) {
user = null;
pwd = null;
}
else {
user = sourceDB.getSessionContext().getUser();
pwd = sourceDB.getSessionContext().getPassword();
}
}
int accLevel = targetDB.openSession(user, pwd);
if (accLevel <= WGDatabase.ACCESSLEVEL_NOACCESS) {
if (_crossLoginMode.equals(WGAXML.DESIGNSHARING_MODE_PARALLEL)) {
throw new WGAuthorisationException("Design sharing databases do not support neccessary logins. Database '" + targetDB.getDbReference() + "' denies access for username '" + user + "' which is accepted by database '" + sourceDB.getDbReference() + "' (or has a different password).");
}
else {
throw new WGAuthorisationException("Design sharing databases do not support neccessary logins. Database '" + targetDB.getDbReference() + "' does not accept anonymous access.");
}
}
}