directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1470141 - /directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Date Sat, 20 Apr 2013 10:13:44 GMT
Author: elecharny
Date: Sat Apr 20 10:13:44 2013
New Revision: 1470141

URL: http://svn.apache.org/r1470141
Log:
o Fixed the isAnonymous() method in coreSession

Modified:
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java?rev=1470141&r1=1470140&r2=1470141&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Sat Apr 20 10:13:44 2013
@@ -488,7 +488,8 @@ public class DefaultCoreSession implemen
         OperationManager operationManager = directoryService.getOperationManager();
 
         PresenceNode filter = new PresenceNode( OBJECT_CLASS_AT );
-        SearchOperationContext searchContext = new SearchOperationContext( this, dn, SearchScope.ONELEVEL,
filter, returningAttributes );
+        SearchOperationContext searchContext = new SearchOperationContext( this, dn, SearchScope.ONELEVEL,
filter,
+            returningAttributes );
         searchContext.setAliasDerefMode( aliasDerefMode );
 
         return operationManager.search( searchContext );
@@ -782,7 +783,7 @@ public class DefaultCoreSession implemen
         }
 
         SearchOperationContext searchContext = new SearchOperationContext( this, dn, SearchScope.OBJECT,
filterNode,
-            (String)null );
+            ( String ) null );
         searchContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
         setReferralHandling( searchContext, ignoreReferrals );
 
@@ -807,7 +808,14 @@ public class DefaultCoreSession implemen
 
     public boolean isAnonymous()
     {
-        return getEffectivePrincipal().getDn().isEmpty();
+        if ( ( authorizedPrincipal == null ) && ( authenticatedPrincipal == null
) )
+        {
+            return true;
+        }
+        else
+        {
+            return getEffectivePrincipal().getDn().isEmpty();
+        }
     }
 
 
@@ -1029,7 +1037,7 @@ public class DefaultCoreSession implemen
     {
         SearchOperationContext searchContext = new SearchOperationContext( this, searchRequest
);
         searchContext.setSyncreplSearch( searchRequest.getControls().containsKey( SyncRequestValue.OID
) );
-        
+
         OperationManager operationManager = directoryService.getOperationManager();
 
         EntryFilteringCursor cursor = null;



Mime
View raw message