You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2015/06/26 18:22:35 UTC

svn commit: r1687803 - in /james/mpt/trunk/impl/imap-mailbox/core/src/main: java/org/apache/james/mpt/imapmailbox/suite/ resources/org/apache/james/imap/scripts/aclIntegration/

Author: btellier
Date: Fri Jun 26 16:22:35 2015
New Revision: 1687803

URL: http://svn.apache.org/r1687803
Log:
MPT-14 ACL integration tests : RENAME CREATE

Added:
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightK.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightX.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightK.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightX.test
Modified:
    james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java

Modified: james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java?rev=1687803&r1=1687802&r2=1687803&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java Fri Jun 26 16:22:35 2015
@@ -62,13 +62,13 @@ public class ACLIntegration extends Base
 
     @Test
     public void rightLShouldBeSufficientToPerformListUS() throws Exception {
-        grantRightsOnHost.grantRights(USER, OTHER_USER_MAILBOX, "l");
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("l"));
         scriptTest("aclIntegration/ACLIntegrationRightL", Locale.US);
     }
 
     @Test
     public void rightLShouldBeNeededToPerformListLsubSubscribeUS() throws Exception {
-        grantRightsOnHost.grantRights(USER, OTHER_USER_MAILBOX, "rswipkxtecda");
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("rswipkxtecda"));
         scriptTest("aclIntegration/ACLIntegrationWithoutRightL", Locale.US);
     }
 
@@ -84,4 +84,36 @@ public class ACLIntegration extends Base
         scriptTest("aclIntegration/ACLIntegrationWithoutRightA", Locale.US);
     }
 
+    @Test
+    public void rightXOnOriginShouldBeSufficientToRenameAMailboxUS() throws Exception {
+        system.createMailbox(new MailboxPath("#private","Boby","test"));
+        grantRightsOnHost.grantRights(new MailboxPath("#private", OTHER_USER_NAME, "test"), USER, new SimpleMailboxACL.Rfc4314Rights("x"));
+        scriptTest("aclIntegration/ACLIntegrationRightX", Locale.US);
+    }
+
+    @Test
+    public void rightXOnOriginShouldBeNeededToRenameAMailboxUS() throws Exception {
+        system.createMailbox(new MailboxPath("#private","Boby","test"));
+        grantRightsOnHost.grantRights(new MailboxPath("#private", OTHER_USER_NAME, "test"), USER, new SimpleMailboxACL.Rfc4314Rights("rswipktela"));
+        scriptTest("aclIntegration/ACLIntegrationWithoutRightX", Locale.US);
+    }
+
+    @Test
+    public void rightKOnDestinationShouldBeSufficientToRenameAMailboxUS() throws Exception {
+        MailboxPath newMailbox = new MailboxPath("#private", USER, "test");
+        system.createMailbox(newMailbox);
+        grantRightsOnHost.grantRights(newMailbox, USER, new SimpleMailboxACL.Rfc4314Rights("x"));
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("k"));
+        scriptTest("aclIntegration/ACLIntegrationRightK", Locale.US);
+    }
+
+    @Test
+    public void rightKOnDestinationShouldBeNeededToRenameAMailboxUS() throws Exception {
+        MailboxPath newMailbox = new MailboxPath("#private", USER, "test");
+        system.createMailbox(newMailbox);
+        grantRightsOnHost.grantRights(newMailbox, USER, new SimpleMailboxACL.Rfc4314Rights("x"));
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("rswipxtela"));
+        scriptTest("aclIntegration/ACLIntegrationWithoutRightK", Locale.US);
+    }
+
 }

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightK.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightK.test?rev=1687803&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightK.test (added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightK.test Fri Jun 26 16:22:35 2015
@@ -0,0 +1,39 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one   #
+# or more contributor license agreements.  See the NOTICE file #
+# distributed with this work for additional information        #
+# regarding copyright ownership.  The ASF licenses this file   #
+# to you under the Apache License, Version 2.0 (the            #
+# "License"); you may not use this file except in compliance   #
+# with the License.  You may obtain a copy of the License at   #
+#                                                              #
+#   http://www.apache.org/licenses/LICENSE-2.0                 #
+#                                                              #
+# Unless required by applicable law or agreed to in writing,   #
+# software distributed under the License is distributed on an  #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       #
+# KIND, either express or implied.  See the License for the    #
+# specific language governing permissions and limitations      #
+# under the License.                                           #
+################################################################
+
+C: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby kc
+S: a001 OK Completed
+
+C: a002 MYRIGHTS user.imapuser.test
+S: \* MYRIGHTS user.imapuser.test lkxca
+S: a002 OK Completed
+
+# Right "k" is needed on the mailbox targeted by the rename
+
+C: a003 RENAME user.imapuser.test user.Boby.test
+S: \* OK rename user.imapuser.test user.Boby.test
+S: a003 OK Completed
+
+C: a004 CREATE user.Boby.yaourt
+S: a004 OK Completed

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightX.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightX.test?rev=1687803&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightX.test (added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightX.test Fri Jun 26 16:22:35 2015
@@ -0,0 +1,32 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one   #
+# or more contributor license agreements.  See the NOTICE file #
+# distributed with this work for additional information        #
+# regarding copyright ownership.  The ASF licenses this file   #
+# to you under the Apache License, Version 2.0 (the            #
+# "License"); you may not use this file except in compliance   #
+# with the License.  You may obtain a copy of the License at   #
+#                                                              #
+#   http://www.apache.org/licenses/LICENSE-2.0                 #
+#                                                              #
+# Unless required by applicable law or agreed to in writing,   #
+# software distributed under the License is distributed on an  #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       #
+# KIND, either express or implied.  See the License for the    #
+# specific language governing permissions and limitations      #
+# under the License.                                           #
+################################################################
+
+C: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby.test
+S: \* MYRIGHTS user.Boby.test xc
+S: a001 OK Completed
+
+# Right "x" is sufficient to rename a mailbox
+
+C: a002 RENAME user.Boby.test user.imapuser.test
+S: \* OK rename user.Boby.test user.imapuser.test
+S: a002 OK Completed

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightK.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightK.test?rev=1687803&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightK.test (added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightK.test Fri Jun 26 16:22:35 2015
@@ -0,0 +1,38 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one   #
+# or more contributor license agreements.  See the NOTICE file #
+# distributed with this work for additional information        #
+# regarding copyright ownership.  The ASF licenses this file   #
+# to you under the Apache License, Version 2.0 (the            #
+# "License"); you may not use this file except in compliance   #
+# with the License.  You may obtain a copy of the License at   #
+#                                                              #
+#   http://www.apache.org/licenses/LICENSE-2.0                 #
+#                                                              #
+# Unless required by applicable law or agreed to in writing,   #
+# software distributed under the License is distributed on an  #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       #
+# KIND, either express or implied.  See the License for the    #
+# specific language governing permissions and limitations      #
+# under the License.                                           #
+################################################################
+
+C: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.imapuser.test
+S: \* MYRIGHTS user.imapuser.test lkxca
+S: a001 OK Completed
+
+C: a002 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby lrswipxtecda
+S: a002 OK Completed
+
+# Right "k" is needed on destination to rename mailboxes
+
+C: a003 RENAME user.imapuser.test user.Boby.test
+S: a003 NO Permission denied
+
+C: a004 CREATE user.Boby.yaourt
+S: a004 NO Permission denied

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightX.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightX.test?rev=1687803&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightX.test (added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightX.test Fri Jun 26 16:22:35 2015
@@ -0,0 +1,31 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one   #
+# or more contributor license agreements.  See the NOTICE file #
+# distributed with this work for additional information        #
+# regarding copyright ownership.  The ASF licenses this file   #
+# to you under the Apache License, Version 2.0 (the            #
+# "License"); you may not use this file except in compliance   #
+# with the License.  You may obtain a copy of the License at   #
+#                                                              #
+#   http://www.apache.org/licenses/LICENSE-2.0                 #
+#                                                              #
+# Unless required by applicable law or agreed to in writing,   #
+# software distributed under the License is distributed on an  #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       #
+# KIND, either express or implied.  See the License for the    #
+# specific language governing permissions and limitations      #
+# under the License.                                           #
+################################################################
+
+C: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby.test
+S: \* MYRIGHTS user.Boby.test lrswipktecda
+S: a001 OK Completed
+
+# Right "a" is sufficient to manage ACL
+
+C: a002 RENAME user.Boby.test user.imapuser.test
+S: a002 NO Permission denied



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org