Restore anonymous repositories browse capability

When porting the GitBlit plugin to GitBlit 1.7.0 we have lost
the ability to browse anonymously the Gerrit repos according to
the ACLs.

Functionality is now restored and Gerrit’s visibility ACLs are
honoured (only public repos are shown, not everything like in GitBlit
anonymous browsing mode).

Change-Id: Id53a9625fe5bc9a82d19e0f28fcac828e13a02de
diff --git a/src/main/java/com/googlesource/gerrit/plugins/gitblit/auth/GerritToGitBlitUserService.java b/src/main/java/com/googlesource/gerrit/plugins/gitblit/auth/GerritToGitBlitUserService.java
index 1d0ce9d..a4bbb2c 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/gitblit/auth/GerritToGitBlitUserService.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/gitblit/auth/GerritToGitBlitUserService.java
@@ -142,14 +142,15 @@
     String gerritUsername =
         (String) httpRequest.getAttribute("gerrit-username");
     String gerritToken = (String) httpRequest.getAttribute("gerrit-token");
-    if (Strings.isNullOrEmpty(gerritUsername)
-        || Strings.isNullOrEmpty(gerritToken)) {
-      return null;
-    }
-
     httpRequest.getSession().setAttribute(Constants.AUTHENTICATION_TYPE,
         AuthenticationType.CONTAINER);
-    return authenticateSSO(gerritUsername, gerritToken);
+    
+    if (Strings.isNullOrEmpty(gerritUsername)
+        || Strings.isNullOrEmpty(gerritToken)) {
+      return GerritToGitBlitUserModel.getAnonymous(projectControl);
+    } else {      
+      return authenticateSSO(gerritUsername, gerritToken);
+    }
   }
 
   @Override