HoussemNasri commented on code in PR #2445: URL: https://github.com/apache/james-project/pull/2445#discussion_r1811001061
########## 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: Maybe containsAll? I had to go into the contain method to verify that all input rights have to be contained. -- 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: notifications-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org