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 rc...@apache.org on 2020/01/21 03:00:03 UTC

[james-project] 05/05: JAMES-2993 renameMailbox should assert that the user owns the destination mailbox

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit d68e701dcfd3049260a2ed745771c99c6433b0f7
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Tue Jan 14 16:36:44 2020 +0700

    JAMES-2993 renameMailbox should assert that the user owns the destination mailbox
---
 .../api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java  | 2 --
 .../main/java/org/apache/james/mailbox/store/StoreMailboxManager.java   | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
index 9fc5c73..04f7918 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
@@ -1619,7 +1619,6 @@ public abstract class MailboxManagerTest<T extends MailboxManager> {
         }
 
         @Test
-        @Disabled("JAMES-2933 renameMailbox does not assert that user is the owner of destination mailbox")
         void renameMailboxShouldThrowWhenToMailboxPathDoesNotBelongToUser() throws Exception {
             session = mailboxManager.createSystemSession(USER_1);
 
@@ -1632,7 +1631,6 @@ public abstract class MailboxManagerTest<T extends MailboxManager> {
         }
 
         @Test
-        @Disabled("JAMES-2933 renameMailbox does not assert that user is the owner of destination mailbox")
         void renameMailboxByIdShouldThrowWhenToMailboxPathDoesNotBelongToUser() throws Exception {
             session = mailboxManager.createSystemSession(USER_1);
 
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
index 6d05e4e..940c88d 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
@@ -512,6 +512,7 @@ public class StoreMailboxManager implements MailboxManager {
         if (mailboxExists(newMailboxPath, session)) {
             throw new MailboxExistsException(newMailboxPath.toString());
         }
+        assertIsOwner(session, newMailboxPath);
         newMailboxPath.assertAcceptable(session.getPathDelimiter());
     }
 


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