jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1146028 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractRepositoryService.java
Date Wed, 13 Jul 2011 13:53:53 GMT
Author: mduerig
Date: Wed Jul 13 13:53:53 2011
New Revision: 1146028

URL: http://svn.apache.org/viewvc?rev=1146028&view=rev
Log:
JCR-3020: AbstractRepositoryService should be able to handle GuestCredentials

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractRepositoryService.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractRepositoryService.java?rev=1146028&r1=1146027&r2=1146028&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractRepositoryService.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractRepositoryService.java
Wed Jul 13 13:53:53 2011
@@ -25,6 +25,7 @@ import java.util.Map;
 
 import javax.jcr.AccessDeniedException;
 import javax.jcr.Credentials;
+import javax.jcr.GuestCredentials;
 import javax.jcr.InvalidItemStateException;
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
@@ -276,6 +277,9 @@ public abstract class AbstractRepository
         if (credentials instanceof SimpleCredentials) {
             userId = ((SimpleCredentials) credentials).getUserID();
         }
+        else if (credentials instanceof GuestCredentials) {
+            userId = "anonymous";
+        }
 
         SessionInfoImpl s = new SessionInfoImpl();
         s.setUserID(userId);



Mime
View raw message