directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r433160 - in /directory/branches/apacheds/1.0: core-unit/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceITest.java core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Date Mon, 21 Aug 2006 05:58:06 GMT
Author: akarasulu
Date: Sun Aug 20 22:58:05 2006
New Revision: 433160

URL: http://svn.apache.org/viewvc?rev=433160&view=rev
Log:
fix for DIRSERVER-708: The SubentryService does not inject correct values for subentry operational
attributes

Modified:
    directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceITest.java
    directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java

Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceITest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceITest.java?rev=433160&r1=433159&r2=433160&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceITest.java
(original)
+++ directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceITest.java
Sun Aug 20 22:58:05 2006
@@ -147,7 +147,6 @@
     
     public void testTrackingOfSubentryOperationals() throws NamingException
     {
-        /*
         addAdministrativeRoles();        
         super.sysRoot.createSubcontext( "cn=collectiveAttributeTestSubentry", 
             getCollectiveAttributeTestSubentry( "collectiveAttributeTestSubentry" ) );
@@ -181,6 +180,5 @@
             accessControlSubentries.contains( "2.5.4.3=collectiveattributetestsubentry,2.5.4.11=system"
) );
         
         assertEquals( 1, accessControlSubentries.size() );
-        */
     }
 }

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?rev=433160&r1=433159&r2=433160&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
(original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Sun Aug 20 22:58:05 2006
@@ -77,16 +77,20 @@
 
     public static final String AUTONOUMOUS_AREA = "autonomousArea";
     public static final String AUTONOUMOUS_AREA_SUBENTRY = "autonomousAreaSubentry";
+    private static final Object AUTONOUMOUS_AREA_SUBENTRY_OC = "autonomousAreaSubentry";
 
     public static final String AC_AREA = "accessControlSpecificArea";
     public static final String AC_INNERAREA = "accessControlInnerArea";
     public static final String AC_SUBENTRY = "accessControlSubentries";
+    private static final String AC_SUBENTRY_OC = "accessControlSubentry";
 
     public static final String SCHEMA_AREA = "subschemaAdminSpecificArea";
     public static final String SCHEMA_AREA_SUBENTRY = "subschemaSubentry";
+    private static final String SCHEMA_SUBENTRY_OC = "subschema";
 
     public static final String COLLECTIVE_AREA = "collectiveAttributeSpecificArea";
     public static final String COLLECTIVE_ATTRIBUTE_SUBENTRIES = "collectiveAttributeSubentries";
+    public static final String COLLECTIVE_SUBENTRY_OC = "collectiveAttributeSubentry";
 
     public static final String COLLECTIVE_INNERAREA = "collectiveAttributeInnerArea";
 
@@ -183,24 +187,24 @@
                 ResultCodeEnum.OBJECTCLASSVIOLATION );
         }
         
-        if ( oc.contains( AUTONOUMOUS_AREA ) )
+        if ( oc.contains( AUTONOUMOUS_AREA_SUBENTRY_OC ) )
         {
-            types &= Subentry.AUTONOMOUS_AREA_SUBENTRY;
+            types |= Subentry.AUTONOMOUS_AREA_SUBENTRY;
         }
         
-        if ( oc.contains( AC_AREA ) || oc.contains( AC_INNERAREA ) )
+        if ( oc.contains( AC_SUBENTRY_OC ) )
         {
-            types &= Subentry.ACCESS_CONTROL_SUBENTRY;
+            types |= Subentry.ACCESS_CONTROL_SUBENTRY;
         }
         
-        if ( oc.contains( SCHEMA_AREA ) )
+        if ( oc.contains( SCHEMA_SUBENTRY_OC ) )
         {
-            types &= Subentry.SCHEMA_SUBENTRY;
+            types |= Subentry.SCHEMA_SUBENTRY;
         }
         
-        if ( oc.contains( COLLECTIVE_AREA ) )
+        if ( oc.contains( COLLECTIVE_SUBENTRY_OC ) )
         {
-            types &= Subentry.COLLECTIVE_SUBENTRY;
+            types |= Subentry.COLLECTIVE_SUBENTRY;
         }
         
         return types;
@@ -466,7 +470,8 @@
                 LdapDN subentryDn = new LdapDN( subentryDnStr );
                 LdapDN apDn = ( LdapDN ) subentryDn.clone();
                 apDn.remove( apDn.size() - 1 );
-                SubtreeSpecification ss = subentryCache.getSubentry( subentryDn.toNormName()
).getSubtreeSpecification();
+                Subentry subentry = subentryCache.getSubentry( subentryDn.toNormName() );
+                SubtreeSpecification ss = subentry.getSubtreeSpecification();
 
                 if ( evaluator.evaluate( ss, apDn, normName, objectClasses ) )
                 {
@@ -485,6 +490,11 @@
                                 operational = new LockableAttributeImpl( AUTONOUMOUS_AREA_SUBENTRY
);
                                 entry.put( operational );
                             }
+                            
+                            if ( subentry.isAutonomousAreaSubentry() )
+                            {
+                                operational.add( subentryDn.toString() );
+                            }
                         }
                         else if ( role.equalsIgnoreCase( AC_AREA ) || role.equalsIgnoreCase(
AC_INNERAREA ) )
                         {
@@ -494,6 +504,11 @@
                                 operational = new LockableAttributeImpl( AC_SUBENTRY );
                                 entry.put( operational );
                             }
+                            
+                            if ( subentry.isAccessControlSubentry() )
+                            {
+                                operational.add( subentryDn.toString() );
+                            }
                         }
                         else if ( role.equalsIgnoreCase( SCHEMA_AREA ) )
                         {
@@ -503,6 +518,11 @@
                                 operational = new LockableAttributeImpl( SCHEMA_AREA_SUBENTRY
);
                                 entry.put( operational );
                             }
+                            
+                            if ( subentry.isSchemaSubentry() )
+                            {
+                                operational.add( subentryDn.toString() );
+                            }
                         }
                         else if ( role.equalsIgnoreCase( COLLECTIVE_AREA )
                             || role.equalsIgnoreCase( COLLECTIVE_INNERAREA ) )
@@ -513,6 +533,11 @@
                                 operational = new LockableAttributeImpl( COLLECTIVE_ATTRIBUTE_SUBENTRIES
);
                                 entry.put( operational );
                             }
+                            
+                            if ( subentry.isCollectiveSubentry() )
+                            {
+                                operational.add( subentryDn.toString() );
+                            }
                         }
                         else
                         {
@@ -527,7 +552,7 @@
                                     + " collectiveAttributeInnerArea.", ResultCodeEnum.CONSTRAINTVIOLATION
);
                         }
 
-                        operational.add( subentryDn.toString() );
+//                        operational.add( subentryDn.toString() );
                     }
                 }
             }



Mime
View raw message