directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r396931 - in /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz: DefaultAuthorizationService.java OldAuthorizationService.java support/ACDFEngine.java support/MaxImmSubFilter.java
Date Tue, 25 Apr 2006 17:29:38 GMT
Author: elecharny
Date: Tue Apr 25 10:29:36 2006
New Revision: 396931

URL: http://svn.apache.org/viewcvs?rev=396931&view=rev
Log:
Renammed OldAutz to DefaultAuthz,
fixed bug DIRSERVER-606

Added:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
      - copied, changed from r396891, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java
Removed:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java
Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
(from r396891, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java&r1=396891&r2=396931&rev=396931&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Tue Apr 25 10:29:36 2006
@@ -56,7 +56,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class OldAuthorizationService extends BaseInterceptor
+public class DefaultAuthorizationService extends BaseInterceptor
 {
     /**
      * the administrator's distinguished {@link Name}
@@ -83,7 +83,7 @@
     /**
      * Creates a new instance.
      */
-    public OldAuthorizationService()
+    public DefaultAuthorizationService()
     {
     }
 
@@ -413,7 +413,7 @@
             public boolean accept( Invocation invocation, SearchResult result, SearchControls
controls )
                 throws NamingException
             {
-                return OldAuthorizationService.this.isSearchable( invocation, result );
+                return DefaultAuthorizationService.this.isSearchable( invocation, result
);
             }
         } );
     }
@@ -433,27 +433,28 @@
             public boolean accept( Invocation invocation, SearchResult result, SearchControls
controls )
                 throws NamingException
             {
-                return OldAuthorizationService.this.isSearchable( invocation, result );
+                return DefaultAuthorizationService.this.isSearchable( invocation, result
);
             }
         } );
     }
 
 
-    private boolean isSearchable( Invocation invocataion, SearchResult result ) throws NamingException
+    private boolean isSearchable( Invocation invocation, SearchResult result ) throws NamingException
     {
         Name dn;
+        Name principalDn = ( ( ServerContext ) invocation.getCaller() ).getPrincipal().getJndiName();
 
         synchronized ( dnParser )
         {
             dn = dnParser.parse( result.getName() );
+            principalDn = dnParser.parse( principalDn.toString() );
         }
 
-        Name principalDn = ( ( ServerContext ) invocataion.getCaller() ).getPrincipal().getJndiName();
         if ( !principalDn.equals( ADMIN_DN ) )
         {
             if ( dn.size() > 2 )
             {
-                if ( dn.startsWith( USER_BASE_DN ) || dn.startsWith( GROUP_BASE_DN ) )
+            	if ( ( dn.startsWith( USER_BASE_DN ) && ( !dn.equals( principalDn )
 )) || dn.startsWith( GROUP_BASE_DN ) )
                 {
                     return false;
                 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=396931&r1=396930&r2=396931&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
Tue Apr 25 10:29:36 2006
@@ -126,7 +126,7 @@
         c.add( "normalizationService" );
         c.add( "authenticationService" );
         c.add( "authorizationService" );
-        c.add( "oldAuthorizationService" );
+        c.add( "defaultAuthorizationService" );
         c.add( "schemaService" );
         c.add( "subentryService" );
         c.add( "operationalAttributeService" );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=396931&r1=396930&r2=396931&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
Tue Apr 25 10:29:36 2006
@@ -116,7 +116,7 @@
         c.add( "normalizationService" );
         c.add( "authenticationService" );
         c.add( "authorizationService" );
-        c.add( "oldAuthorizationService" );
+        c.add( "defaultAuthorizationService" );
         c.add( "schemaService" );
         c.add( "subentryService" );
         c.add( "operationalAttributeService" );



Mime
View raw message