directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r958043 - in /directory/shared/trunk/ldap/src: main/antlr/ main/java/org/apache/directory/shared/ldap/aci/ test/java/org/apache/directory/shared/ldap/aci/ test/java/org/apache/directory/shared/ldap/schema/syntax/
Date Fri, 25 Jun 2010 17:25:14 GMT
Author: elecharny
Date: Fri Jun 25 17:25:13 2010
New Revision: 958043

URL: http://svn.apache.org/viewvc?rev=958043&view=rev
Log:
o Unrelaxed the userFirst rule
o ACITuple is not anymore serializable
o added some javadoc
o Removed tests for relaxed userFirst

Modified:
    directory/shared/trunk/ldap/src/main/antlr/ACIItem.g
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ACIItemSyntaxCheckerTest.java

Modified: directory/shared/trunk/ldap/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/ACIItem.g?rev=958043&r1=958042&r2=958043&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/ACIItem.g Fri Jun 25 17:25:13 2010
@@ -362,13 +362,7 @@ userFirst
     :
     ID_userFirst ( SP )* COLON ( SP )*
         OPEN_CURLY ( SP )*
-            (
-              userClasses ( SP )*
-                SEP ( SP )* userPermissions
-            | // relaxing
-              userPermissions ( SP )*
-                SEP ( SP )* userClasses
-            )
+              userClasses ( SP )* SEP ( SP )* userPermissions
         ( SP )* CLOSE_CURLY
     {
         isItemFirstACIItem = false;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java?rev=958043&r1=958042&r2=958043&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
Fri Jun 25 17:25:13 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.shared.ldap.aci;
 
 
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -37,38 +36,36 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ACITuple implements Serializable
+public class ACITuple
 {
-    private static final long serialVersionUID = 4353150626941232371L;
-
+    /** The collection of {@link UserClass}es this tuple relates to **/
     private final Collection<UserClass> userClasses;
 
+    /** The level of authentication required */
     private final AuthenticationLevel authenticationLevel;
 
+    /** The collection of {@link ProtectedItem}s this tuple relates */
     private final Collection<ProtectedItem> protectedItems;
 
+    /** The set of {@link MicroOperation}s this tuple relates */
     private final Set<MicroOperation> microOperations;
 
+    /** Tells if this tuple grant some access */
     private final boolean grant;
 
+    /** The precedence for this tuple */
     private final Integer precedence;
 
 
     /**
      * Creates a new instance.
      * 
-     * @param userClasses
-     *            the collection of {@link UserClass}es this tuple relates to
-     * @param authenticationLevel
-     *            the level of authentication required
-     * @param protectedItems
-     *            the collection of {@link ProtectedItem}s this tuple relates
-     * @param microOperations
-     *            the set of {@link MicroOperation}s this tuple relates
-     * @param grant
-     *            <tt>true</tt> if and only if this tuple grants an access
-     * @param precedence
-     *            the precedence of this tuple (<tt>0</tt>-<tt>255</tt>)
+     * @param userClasses the collection of {@link UserClass}es this tuple relates to
+     * @param authenticationLevel the level of authentication required
+     * @param protectedItems the collection of {@link ProtectedItem}s this tuple relates
+     * @param microOperations the set of {@link MicroOperation}s this tuple relates
+     * @param grant <tt>true</tt> if and only if this tuple grants an access
+     * @param precedence the precedence of this tuple (<tt>0</tt>-<tt>255</tt>)
      */
     public ACITuple( 
             Collection<UserClass> userClasses, 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java?rev=958043&r1=958042&r2=958043&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
Fri Jun 25 17:25:13 2010
@@ -137,6 +137,11 @@ public class ItemFirstACIItem extends AC
     }
 
 
+    /**
+     * Transform this protected Item and permissions to a set of Tuples
+     * 
+     * @return The list of created Tuples
+     */
     public Collection<ACITuple> toTuples()
     {
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java?rev=958043&r1=958042&r2=958043&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemChekerTest.java
Fri Jun 25 17:25:13 2010
@@ -188,19 +188,6 @@ public class ACIItemChekerTest
 
 
     @Test
-    public void testUserFirstComponentsOrderDoesNotMatter() throws Exception
-    {
-        String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
-            + "itemOrUserFirst userFirst:  { userPermissions { { protectedItems{ entry  ,
attributeType { cn  , ou }  , attributeValue {x=y,m=n,k=l} , "
-            + "rangeOfValues (cn=ErsinEr) }  , grantsAndDenials { grantBrowse } } }, userClasses
{  allUsers  , name { \"ou=people,cn=ersin\" }, "
-            + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
-            + "minimum  1, maximum   2 } } } }  }   ";
-
-        checker.parse( spec );
-    }
-
-
-    @Test
     public void testRestrictedValueComponentsOrderDoesNotMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
@@ -228,19 +215,6 @@ public class ACIItemChekerTest
     }
 
 
-    @Test
-    public void testSubtreeSpecificationComponentsOrderDoesNotMatter() throws Exception
-    {
-        String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
-            + "itemOrUserFirst userFirst:  { userPermissions { { protectedItems{ entry  ,
attributeType { cn  , ou }  , attributeValue {x=y,m=n,k=l} , "
-            + "rangeOfValues (cn=ErsinEr) }  , grantsAndDenials { grantBrowse } } }, userClasses
{  allUsers  , name { \"ou=people,cn=ersin\" }, "
-            + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
-            + " maximum   2, minimum  1 } } }  }  }   ";
-
-        checker.parse( spec );
-    }
-    
-    
     /**
      * Test case for DIRSERVER-891
      */

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java?rev=958043&r1=958042&r2=958043&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
Fri Jun 25 17:25:13 2010
@@ -367,20 +367,6 @@ public class ACIItemParserTest
 
 
     @Test 
-    public void testUserFirstComponentsOrderDoesNotMatter() throws Exception
-    {
-        String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
-            + "itemOrUserFirst userFirst:  { userPermissions { { protectedItems{ entry  ,
attributeType { cn  , ou }  , attributeValue {x=y,m=n,k=l} , "
-            + "rangeOfValues (cn=ErsinEr) }  , grantsAndDenials { grantBrowse } } }, userClasses
{  allUsers  , name { \"ou=people,cn=ersin\" }, "
-            + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
-            + "minimum  1, maximum   2 } } } }  }   ";
-
-        ACIItem item = parser.parse( spec );
-        checkItemToString( spec, item );
-    }
-
-
-    @Test 
     public void testGrantAndDenialBitsOrderDoesNotMatterButDuplicatesMatter() throws Exception
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
@@ -443,20 +429,6 @@ public class ACIItemParserTest
     }
     
     
-    @Test 
-    public void testSubtreeSpecificationComponentsOrderDoesNotMatter() throws Exception
-    {
-        String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
-            + "itemOrUserFirst userFirst:  { userPermissions { { protectedItems{ entry  ,
attributeType { cn  , ou }  , attributeValue {x=y,m=n,k=l} , "
-            + "rangeOfValues (cn=ErsinEr) }  , grantsAndDenials { grantBrowse } } }, userClasses
{  allUsers  , name { \"ou=people,cn=ersin\" }, "
-            + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
-            + " maximum   2, minimum  1 } } }  }  }   ";
-
-        ACIItem item = parser.parse( spec );
-        checkItemToString( spec, item );
-    }
-    
-    
     /**
      * Test case for DIRSERVER-891
      */

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ACIItemSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ACIItemSyntaxCheckerTest.java?rev=958043&r1=958042&r2=958043&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ACIItemSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ACIItemSyntaxCheckerTest.java
Fri Jun 25 17:25:13 2010
@@ -199,19 +199,6 @@ public class ACIItemSyntaxCheckerTest
 
 
     @Test
-    public void testUserFirstComponentsOrderDoesNotMatter()
-    {
-        String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
-            + "itemOrUserFirst userFirst:  { userPermissions { { protectedItems{ entry  ,
attributeType { cn  , ou }  , attributeValue {x=y,m=n,k=l} , "
-            + "rangeOfValues (cn=ErsinEr) }  , grantsAndDenials { grantBrowse } } }, userClasses
{  allUsers  , name { \"ou=people,cn=ersin\" }, "
-            + "subtree {{ base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
-            + "minimum  1, maximum   2 } } } }  }   ";
-
-        assertTrue( checker.isValidSyntax( spec ) );
-    }
-
-
-    @Test
     public void testRestrictedValueComponentsOrderDoesNotMatter()
     {
         String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
@@ -239,18 +226,6 @@ public class ACIItemSyntaxCheckerTest
     }
 
 
-    @Test
-    public void testSubtreeSpecificationComponentsOrderDoesNotMatter()
-    {
-        String spec = "{ identificationTag \"id2\"   , precedence 14, authenticationLevel
none  , "
-            + "itemOrUserFirst userFirst:  { userPermissions { { protectedItems{ entry  ,
attributeType { cn  , ou }  , attributeValue {x=y,m=n,k=l} , "
-            + "rangeOfValues (cn=ErsinEr) }  , grantsAndDenials { grantBrowse } } }, userClasses
{  allUsers  , name { \"ou=people,cn=ersin\" }, "
-            + "subtree {{ minimum 7, maximum 9, base \"ou=system\" }, { base \"ou=ORGANIZATIONUNIT\","
-            + " maximum   2, minimum  1 } } }  }  }   ";
-
-        assertTrue( checker.isValidSyntax( spec ) );
-    }
-    
     /**
      * Test case for DIRSERVER-891
      */
@@ -276,6 +251,7 @@ public class ACIItemSyntaxCheckerTest
         assertFalse( checker.isValidSyntax( spec ) );
     }
     
+    
     /**
      * Test case for DIRSERVER-891
      */



Mime
View raw message