directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r952031 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Date Mon, 07 Jun 2010 00:47:17 GMT
Author: elecharny
Date: Mon Jun  7 00:47:16 2010
New Revision: 952031

URL: http://svn.apache.org/viewvc?rev=952031&view=rev
Log:
Slight speed-ups by using a DN ref instead of a clone.
Used DN instead of Strings.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=952031&r1=952030&r2=952031&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Mon Jun  7 00:47:16 2010
@@ -210,9 +210,9 @@ public class DefaultAuthorizationInterce
     }
 
 
-    private boolean isTheAdministrator( DN normalizedDn )
+    private boolean isTheAdministrator( DN dn )
     {
-        return normalizedDn.equals( ADMIN_SYSTEM_DN );
+        return dn.equals( ADMIN_SYSTEM_DN );
     }
 
 
@@ -394,7 +394,7 @@ public class DefaultAuthorizationInterce
             return entry;
         }
 
-        protectLookUp( session.getEffectivePrincipal().getDN(), opContext.getDn() );
+        protectLookUp( session.getEffectivePrincipal().getDNRef(), opContext.getDn() );
 
         return entry;
     }
@@ -422,7 +422,7 @@ public class DefaultAuthorizationInterce
                 if ( normalizedDn.isChildOf( GROUP_BASE_DN ) )
                 {
                     // allow for self reads
-                    if ( normalizedDn.getNormName().equals( principalDn.getNormName() ) )
+                    if ( normalizedDn.equals( principalDn ) )
                     {
                         return;
                     }
@@ -510,7 +510,7 @@ public class DefaultAuthorizationInterce
         }
 
         // Users reading their own entries should be allowed to see all
-        boolean isSelfRead = dn.getNormName().equals( principalDn.getNormName() );
+        boolean isSelfRead = dn.equals( principalDn );
 
         if ( isSelfRead )
         {
@@ -523,8 +523,7 @@ public class DefaultAuthorizationInterce
             // stuff this if in here instead of up in outer if to prevent 
             // constant needless reexecution for all entries in other depths
 
-            if ( dn.getNormName().endsWith( ADMIN_SYSTEM_DN.getNormName() )
-                || dn.getNormName().endsWith( GROUP_BASE_DN.getNormName() ) )
+            if ( dn.isChildOf( ADMIN_SYSTEM_DN ) || dn.isChildOf( GROUP_BASE_DN ) )
             {
                 return false;
             }



Mime
View raw message