JAMES-2186 JMAP integration: AclProbe: add addRights method

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

Branch: refs/heads/master
Commit: 3104280d40d95c6afff3dde75703a82adb96faaf
Parents: 33d68a7
Author: Luc DUZAN <[email protected]>
Authored: Mon Oct 16 14:55:14 2017 +0700
Committer: Matthieu Baechler <[email protected]>
Committed: Mon Oct 23 13:50:38 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/james/mailbox/store/probe/ACLProbe.java  | 2 ++
 .../src/main/java/org/apache/james/modules/ACLProbeImpl.java | 8 ++++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/3104280d/mailbox/store/src/main/java/org/apache/james/mailbox/store/probe/ACLProbe.java
----------------------------------------------------------------------
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/probe/ACLProbe.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/probe/ACLProbe.java
index 1c5ba4d..600dd9b 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/probe/ACLProbe.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/probe/ACLProbe.java
@@ -27,5 +27,7 @@ import org.apache.james.mailbox.model.MailboxPath;
 public interface ACLProbe {
     void replaceRights(MailboxPath mailboxPath, String targetUser, 
Rfc4314Rights rights) throws MailboxException;
 
+    void addRights(MailboxPath mailboxPath, String targetUser, Rfc4314Rights 
rights) throws MailboxException;
+
     MailboxACL retrieveRights(MailboxPath mailboxPath) throws MailboxException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/3104280d/server/container/guice/mailbox/src/main/java/org/apache/james/modules/ACLProbeImpl.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/ACLProbeImpl.java
 
b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/ACLProbeImpl.java
index 801ebe7..61b8ddf 100644
--- 
a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/ACLProbeImpl.java
+++ 
b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/ACLProbeImpl.java
@@ -50,6 +50,14 @@ public class ACLProbeImpl implements GuiceProbe, ACLProbe {
     }
 
     @Override
+    public void addRights(MailboxPath mailboxPath, String targetUser, 
Rfc4314Rights rights) throws MailboxException {
+        MailboxSession mailboxSession = 
mailboxManager.createSystemSession(mailboxPath.getUser());
+        ACLCommand command = 
MailboxACL.command().forUser(targetUser).rights(rights).asAddition();
+
+        mailboxManager.applyRightsCommand(mailboxPath, command, 
mailboxSession);
+    }
+
+    @Override
     public MailboxACL retrieveRights(MailboxPath mailboxPath) throws 
MailboxException {
         MailboxSession mailboxSession = 
mailboxManager.createSystemSession(mailboxPath.getUser());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to