directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r553468 - in /directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz: AbstractAuthorizationITest.java ModifyAuthorizationITest.java
Date Thu, 05 Jul 2007 11:54:57 GMT
Author: ersiner
Date: Thu Jul  5 04:54:56 2007
New Revision: 553468

URL: http://svn.apache.org/viewvc?view=rev&rev=553468
Log:
Fixed broken test due to new handling of allAttributeValues protectedItem. Added a utility
for replacing an existing prescriptiveACI attribute.

Modified:
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java?view=diff&rev=553468&r1=553467&r2=553468
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java
Thu Jul  5 04:54:56 2007
@@ -339,4 +339,18 @@
         Attributes changes = new AttributesImpl( "subentryACI", aciItem, true );
         adminCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
     }
+    
+    
+    /**
+     * Replaces values of an prescriptiveACI attribute of a subentry subordinate
+     * to ou=system.
+     * @throws NamingException 
+     *
+     */
+    public void changePresciptiveACI( String cn, String aciItem ) throws NamingException
+    {
+        DirContext adminCtx = getContextAsAdmin();
+        Attributes changes = new AttributesImpl( "prescriptiveACI", aciItem );
+        adminCtx.modifyAttributes( "cn=" + cn, DirContext.REPLACE_ATTRIBUTE, changes );
+    }
 }

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java?view=diff&rev=553468&r1=553467&r2=553468
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
Thu Jul  5 04:54:56 2007
@@ -327,7 +327,7 @@
             + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst:
{ "
             + "userClasses { userGroup { \"cn=TestGroup,ou=groups,ou=system\" } }, " + "userPermissions
{ "
             + "{ protectedItems {entry}, grantsAndDenials { grantModify, grantBrowse } },
"
-            + "{ protectedItems {allAttributeValues {telephoneNumber}}, grantsAndDenials
{ grantRemove } } " + "} } }" );
+            + "{ protectedItems {attributeType {telephoneNumber}, allAttributeValues {telephoneNumber}},
grantsAndDenials { grantRemove } } " + "} } }" );
 
         // try a modify operation which should succeed with ACI and group membership change
         assertTrue( checkCanModifyAs( "billyd", "billyd", "ou=testou", mods ) );
@@ -397,7 +397,7 @@
             + "precedence 14, " + "authenticationLevel none, " + "itemOrUserFirst userFirst:
{ "
             + "userClasses { userGroup { \"cn=TestGroup,ou=groups,ou=system\" } }, " + "userPermissions
{ "
             + "{ protectedItems {entry}, grantsAndDenials { grantModify, grantBrowse } },
"
-            + "{ protectedItems {allAttributeValues {telephoneNumber}}, grantsAndDenials
{ grantRemove } } " + "} } }" );
+            + "{ protectedItems {attributeType {telephoneNumber}, allAttributeValues {telephoneNumber}},
grantsAndDenials { grantRemove } } " + "} } }" );
 
         // try a modify operation which should succeed with ACI and group membership change
         assertTrue( checkCanModifyAs( "billyd", "billyd", "ou=testou", DirContext.REMOVE_ATTRIBUTE,
changes ) );
@@ -514,4 +514,6 @@
     //        // should work with billyd now that all users are authorized
     //        assertTrue( checkCanModifyAs( "billyd", "billyd", "ou=testou", "867-5309" )
);
     //    }
+    
+    
 }



Mime
View raw message