Arsnael commented on code in PR #2445:
URL: https://github.com/apache/james-project/pull/2445#discussion_r1818343960
##########
mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java:
##########
@@ -675,12 +679,43 @@ private void trimFlags(Flags flags, MailboxSession
session) {
}
- @Override
- public Map<MessageUid, Flags> setFlags(final Flags flags, final
FlagsUpdateMode flagsUpdateMode, final MessageRange set, MailboxSession
mailboxSession) throws MailboxException {
+ public Optional<MailboxException> ensureFlagsWrite(Flags flags,
FlagsUpdateMode flagsUpdateMode, MailboxSession mailboxSession) {
+ MailboxACL.Rfc4314Rights myRights =
storeRightManager.myRights(mailbox, mailboxSession);
- if (!isWriteable(mailboxSession)) {
- throw new ReadOnlyException(getMailboxPath());
+ if (flagsUpdateMode.equals(FlagsUpdateMode.REPLACE)) {
+ if (!myRights.contains(MailboxACL.Right.Write,
MailboxACL.Right.WriteSeenFlag, MailboxACL.Right.DeleteMessages)) {
Review Comment:
Looks rather clear to me, no need to change IMO
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]