Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 22586 invoked from network); 25 Jun 2010 17:26:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jun 2010 17:26:11 -0000 Received: (qmail 62580 invoked by uid 500); 25 Jun 2010 17:26:11 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 62303 invoked by uid 500); 25 Jun 2010 17:26:11 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 62295 invoked by uid 99); 25 Jun 2010 17:26:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 17:26:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 17:26:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7040023889E2; Fri, 25 Jun 2010 17:25:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100625172514.7040023889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 Apache Directory Project */ -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 userClasses; + /** The level of authentication required */ private final AuthenticationLevel authenticationLevel; + /** The collection of {@link ProtectedItem}s this tuple relates */ private final Collection protectedItems; + /** The set of {@link MicroOperation}s this tuple relates */ private final Set 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 - * true if and only if this tuple grants an access - * @param precedence - * the precedence of this tuple (0-255) + * @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 true if and only if this tuple grants an access + * @param precedence the precedence of this tuple (0-255) */ public ACITuple( Collection 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 toTuples() { Collection tuples = new ArrayList(); 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 */