directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r396739 - /directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Date Tue, 25 Apr 2006 00:15:00 GMT
Author: elecharny
Date: Mon Apr 24 17:14:59 2006
New Revision: 396739

URL: http://svn.apache.org/viewcvs?rev=396739&view=rev
Log:
- Renamed OldAuthorizationService to DefaultAuthorizationService
- Fixed the DIRSERVER-606 by applying Stefan patch

Added:
    directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
      - copied, changed from r396277, directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java

Copied: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
(from r396277, directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java)
URL: http://svn.apache.org/viewcvs/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?p2=directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java&p1=directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java&r1=396277&r2=396739&rev=396739&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/OldAuthorizationService.java
(original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Mon Apr 24 17:14:59 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,28 +433,34 @@
             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 ) )
+            	{
+                	/*if ( dn.equals( dnParser.parse( principalDn.toString() ) ) )
+                	{
+                		return true;
+                	}*/
+                	
                     return false;
                 }
             }



Mime
View raw message