directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r433161 - in /directory/trunks/apacheds: 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 06:00:33 GMT
Author: akarasulu
Date: Sun Aug 20 23:00:32 2006
New Revision: 433161

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

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

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

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?rev=433161&r1=433160&r2=433161&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Sun Aug 20 23:00:32 2006
@@ -77,22 +77,27 @@
 
     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_INNERAREA = "collectiveAttributeInnerArea";
     public static final String COLLECTIVE_ATTRIBUTE_SUBENTRIES = "collectiveAttributeSubentries";
+    public static final String COLLECTIVE_SUBENTRY_OC = "collectiveAttributeSubentry";
     
     public static final String TRIGGER_AREA = "triggerSpecificArea";
     public static final String TRIGGER_INNERAREA = "triggerInnerArea";
     public static final String TRIGGER_SUBENTRIES = "triggerSubentries";
 
+
     public static final String[] SUBENTRY_OPATTRS =
         { AUTONOUMOUS_AREA_SUBENTRY, AC_SUBENTRY, SCHEMA_AREA_SUBENTRY, COLLECTIVE_ATTRIBUTE_SUBENTRIES,
TRIGGER_SUBENTRIES };
 
@@ -186,24 +191,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;
@@ -478,7 +483,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 ) )
                 {
@@ -497,6 +503,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 ) )
                         {
@@ -506,6 +517,11 @@
                                 operational = new LockableAttributeImpl( AC_SUBENTRY );
                                 entry.put( operational );
                             }
+                            
+                            if ( subentry.isAccessControlSubentry() )
+                            {
+                                operational.add( subentryDn.toString() );
+                            }
                         }
                         else if ( role.equalsIgnoreCase( SCHEMA_AREA ) )
                         {
@@ -515,6 +531,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 ) )
@@ -525,6 +546,11 @@
                                 operational = new LockableAttributeImpl( COLLECTIVE_ATTRIBUTE_SUBENTRIES
);
                                 entry.put( operational );
                             }
+                            
+                            if ( subentry.isCollectiveSubentry() )
+                            {
+                                operational.add( subentryDn.toString() );
+                            }
                         }
                         else if ( role.equalsIgnoreCase( TRIGGER_AREA ) || role.equalsIgnoreCase(
TRIGGER_INNERAREA ) )
                         {
@@ -548,7 +574,7 @@
                                     + " triggerArea and triggerInnerArea.", ResultCodeEnum.CONSTRAINTVIOLATION
);
                         }
 
-                        operational.add( subentryDn.toString() );
+//                        operational.add( subentryDn.toString() );
                     }
                 }
             }



Mime
View raw message