JAMES-2182 JamesImapHostSystem support function for setting right on mailbox


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/10cd0d9a
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/10cd0d9a
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/10cd0d9a

Branch: refs/heads/master
Commit: 10cd0d9a4a51ebef80f5c4584d9172b04e82fa65
Parents: d479320
Author: quynhn <qngu...@linagora.com>
Authored: Wed Oct 11 16:14:32 2017 +0700
Committer: benwa <btell...@linagora.com>
Committed: Wed Oct 18 09:02:16 2017 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/mpt/api/ImapHostSystem.java   |  3 +++
 .../org/apache/james/mpt/host/ExternalHostSystem.java   |  6 ++++++
 .../imapmailbox/cassandra/host/CassandraHostSystem.java | 11 +++++++++++
 .../org/apache/james/mpt/host/JamesImapHostSystem.java  |  6 +++++-
 .../elasticsearch/host/ElasticSearchHostSystem.java     | 11 +++++++++++
 .../mpt/imapmailbox/hbase/host/HBaseHostSystem.java     | 11 +++++++++++
 .../imapmailbox/inmemory/host/InMemoryHostSystem.java   | 11 +++++++++++
 .../james/mpt/imapmailbox/jcr/host/JCRHostSystem.java   | 12 +++++++++++-
 .../james/mpt/imapmailbox/jpa/host/JPAHostSystem.java   | 11 +++++++++++
 .../lucenesearch/host/LuceneSearchHostSystem.java       | 10 ++++++++++
 .../mpt/imapmailbox/maildir/host/MaildirHostSystem.java | 11 +++++++++++
 11 files changed, 101 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/core/src/main/java/org/apache/james/mpt/api/ImapHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/core/src/main/java/org/apache/james/mpt/api/ImapHostSystem.java 
b/mpt/core/src/main/java/org/apache/james/mpt/api/ImapHostSystem.java
index 472b227..a9fe170 100644
--- a/mpt/core/src/main/java/org/apache/james/mpt/api/ImapHostSystem.java
+++ b/mpt/core/src/main/java/org/apache/james/mpt/api/ImapHostSystem.java
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.mpt.api;
 
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mpt.api.ImapFeatures.Feature;
 
@@ -28,4 +29,6 @@ public interface ImapHostSystem extends HostSystem {
     void createMailbox(MailboxPath mailboxPath) throws Exception;
 
     void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) throws 
Exception;
+
+    void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java 
b/mpt/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java
index be59cb3..98f443b 100644
--- a/mpt/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java
+++ b/mpt/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java
@@ -20,6 +20,7 @@
 package org.apache.james.mpt.host;
 
 import org.apache.commons.lang.NotImplementedException;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mpt.api.ImapFeatures;
 import org.apache.james.mpt.api.ImapFeatures.Feature;
@@ -112,4 +113,9 @@ public class ExternalHostSystem extends 
ExternalSessionFactory implements ImapHo
     public void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) 
throws Exception {
         throw new NotImplementedException();
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        throw new NotImplementedException();
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
 
b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
index 8f2b4c0..0aaffcb 100644
--- 
a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
@@ -47,6 +47,7 @@ import 
org.apache.james.mailbox.cassandra.modules.CassandraUidModule;
 import org.apache.james.mailbox.cassandra.quota.CassandraCurrentQuotaManager;
 import 
org.apache.james.mailbox.cassandra.quota.CassandraPerUserMaxQuotaManager;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
@@ -158,4 +159,14 @@ public class CassandraHostSystem extends 
JamesImapHostSystem {
         perUserMaxQuotaManager.setDefaultMaxMessage(maxMessageQuota);
         perUserMaxQuotaManager.setDefaultMaxStorage(maxStorageQuota);
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/JamesImapHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/JamesImapHostSystem.java
 
b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/JamesImapHostSystem.java
index d1bc8af..bb8abdb 100644
--- 
a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/JamesImapHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/JamesImapHostSystem.java
@@ -29,6 +29,7 @@ import org.apache.james.imap.api.process.ImapProcessor;
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.decode.main.ImapRequestStreamHandler;
 import org.apache.james.imap.encode.ImapEncoder;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.Authenticator;
 import org.apache.james.mailbox.store.Authorizator;
@@ -36,12 +37,13 @@ import org.apache.james.mpt.api.Continuation;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.helper.ByteBufferInputStream;
 import org.apache.james.mpt.helper.ByteBufferOutputStream;
+import org.apache.james.mpt.imapmailbox.GrantRightsOnHost;
 import org.apache.james.mpt.session.ImapSessionImpl;
 import org.apache.james.user.memory.MemoryUsersRepository;
 
 import com.google.common.base.Throwables;
 
-public abstract class JamesImapHostSystem implements ImapHostSystem {
+public abstract class JamesImapHostSystem implements ImapHostSystem, 
GrantRightsOnHost {
 
     private MemoryUsersRepository memoryUsersRepository;
     protected Authorizator authorizator;
@@ -89,6 +91,8 @@ public abstract class JamesImapHostSystem implements 
ImapHostSystem {
     
     public abstract void createMailbox(MailboxPath mailboxPath) throws 
Exception;
 
+    public abstract void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception;
+
     class Session implements org.apache.james.mpt.api.Session {
         ByteBufferOutputStream out;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
 
b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
index 288ca22..3ae5818 100644
--- 
a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
@@ -52,6 +52,7 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.inmemory.InMemoryMessageId;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.StoreMailboxManager;
@@ -151,4 +152,14 @@ public class ElasticSearchHostSystem extends 
JamesImapHostSystem {
     public void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) 
throws Exception {
         throw new NotImplementedException();
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
 
b/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
index 557d609..fae8500 100644
--- 
a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
@@ -40,6 +40,7 @@ import org.apache.james.mailbox.hbase.HBaseMailboxManager;
 import org.apache.james.mailbox.hbase.HBaseMailboxSessionMapperFactory;
 import org.apache.james.mailbox.hbase.mail.HBaseModSeqProvider;
 import org.apache.james.mailbox.hbase.mail.HBaseUidProvider;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
 import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
@@ -168,4 +169,14 @@ public class HBaseHostSystem extends JamesImapHostSystem {
     public void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) 
throws Exception {
         throw new NotImplementedException();
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
 
b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
index 8dc8eff..8a07469 100644
--- 
a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
@@ -33,6 +33,7 @@ import 
org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.inmemory.InMemoryMessageId;
 import org.apache.james.mailbox.inmemory.quota.InMemoryCurrentQuotaManager;
 import org.apache.james.mailbox.inmemory.quota.InMemoryPerUserMaxQuotaManager;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
@@ -112,4 +113,14 @@ public class InMemoryHostSystem extends 
JamesImapHostSystem {
         perUserMaxQuotaManager.setDefaultMaxMessage(maxMessageQuota);
         perUserMaxQuotaManager.setDefaultMaxStorage(maxStorageQuota);
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
 
b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
index 12b6888..8fb9322 100644
--- 
a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
@@ -40,6 +40,7 @@ import org.apache.james.mailbox.jcr.JCRSubscriptionManager;
 import org.apache.james.mailbox.jcr.JCRUtils;
 import org.apache.james.mailbox.jcr.mail.JCRModSeqProvider;
 import org.apache.james.mailbox.jcr.mail.JCRUidProvider;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
@@ -171,5 +172,14 @@ public class JCRHostSystem extends JamesImapHostSystem {
     public void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) 
throws Exception {
         throw new NotImplementedException();
     }
-    
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
 
b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
index d87e6a5..763752f 100644
--- 
a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
@@ -44,6 +44,7 @@ import org.apache.james.mailbox.jpa.mail.JPAUidProvider;
 import org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager;
 import org.apache.james.mailbox.jpa.quota.JPAPerUserMaxQuotaManager;
 import org.apache.james.mailbox.jpa.quota.JpaCurrentQuotaManager;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
@@ -157,4 +158,14 @@ public class JPAHostSystem extends JamesImapHostSystem {
         maxQuotaManager.setDefaultMaxMessage(maxMessageQuota);
         maxQuotaManager.setDefaultMaxStorage(maxStorageQuota);
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
 
b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
index 5ca521f..ad8bbd2 100644
--- 
a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
@@ -47,6 +47,7 @@ import org.apache.james.mailbox.jpa.mail.JPAModSeqProvider;
 import org.apache.james.mailbox.jpa.mail.JPAUidProvider;
 import org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.MessageId;
@@ -159,4 +160,13 @@ public class LuceneSearchHostSystem extends 
JamesImapHostSystem {
         throw new NotImplementedException();
     }
 
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/10cd0d9a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
 
b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
index f03ad97..2316551 100644
--- 
a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
+++ 
b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
@@ -32,6 +32,7 @@ import 
org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.maildir.MaildirMailboxSessionMapperFactory;
 import org.apache.james.mailbox.maildir.MaildirStore;
+import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.StoreMailboxManager;
@@ -120,4 +121,14 @@ public class MaildirHostSystem extends JamesImapHostSystem 
{
     public void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) 
throws Exception {
         throw new NotImplementedException();
     }
+
+    @Override
+    public void grantRights(MailboxPath mailboxPath, String userName, 
MailboxACL.Rfc4314Rights rights) throws Exception {
+        mailboxManager.setRights(mailboxPath,
+            MailboxACL.EMPTY.apply(MailboxACL.command()
+                .forUser(userName)
+                .rights(rights)
+                .asAddition()),
+            mailboxManager.createSystemSession(userName));
+    }
 }


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

Reply via email to