iResponse.send(OHttpUtils.STATUS_AUTH_CODE, OHttpUtils.STATUS_AUTH_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN,
"401 Unauthorized.", header, false);
}
protected ODatabaseDocumentTx getProfiledDatabaseInstance(final OHttpRequest iRequest) throws InterruptedException {
if (iRequest.authorization == null)
<BUG>throw new OSecurityAccessException(iRequest.databaseName, "No user and password received");
final List<String> parts = OStringSerializerHelper.split(iRequest.authorization, ':');
final ODatabaseDocumentTx db = OSharedDocumentDatabase.acquire(iRequest.databaseName, parts.get(0), parts.get(1));

ODatabaseRecord localDatabase = ODatabaseRecordThreadLocal.INSTANCE.getIfDefined();
String currentUserId = iRequest.data.currentUserId;</BUG>
if (currentUserId != null && currentUserId.length() > 0 && localDatabase != null && localDatabase.getUser() != null) {

iResponse.send(OHttpUtils.STATUS_AUTH_CODE, OHttpUtils.STATUS_AUTH_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN,
"401 Unauthorized.", header, false);
}
protected ODatabaseDocumentTx getProfiledDatabaseInstance(final OHttpRequest iRequest) throws InterruptedException {
if (iRequest.authorization == null)
throw new OSecurityAccessException(iRequest.databaseName, "No user and password received");
ODatabaseRecord localDatabase = ODatabaseRecordThreadLocal.INSTANCE.getIfDefined();
if (localDatabase == null) {
final List<String> parts = OStringSerializerHelper.split(iRequest.authorization, ':');
localDatabase = (ODatabaseDocumentTx) server.openDatabase("document", iRequest.databaseName, parts.get(0), parts.get(1));
} else {
String currentUserId = iRequest.data.currentUserId;
if (currentUserId != null && currentUserId.length() > 0 && localDatabase != null && localDatabase.getUser() != null) {
