chibenwa commented on code in PR #2491:
URL: https://github.com/apache/james-project/pull/2491#discussion_r1833608369


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/MailboxSet.scala:
##########
@@ -292,7 +295,12 @@ object SharedWithPartialUpdate {
     if (capabilities.contains(CapabilityIdentifier.JAMES_SHARES)) {
       parseEntryKey(property)
         .flatMap(entryKey => parseRights(newValue, property, serializer)
-          .map(rights => SharedWithPartialUpdate(entryKey, rights)))
+          .flatMap {rights =>
+            if ((entryKey == ANYONE_KEY || entryKey == ANYONE_NEGATIVE_KEY) && 
rights.toRights.exists(_ != Right.Post)) {

Review Comment:
   This complicated condition needs refactoring (method / variable extraction)



##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/MailboxSet.scala:
##########
@@ -270,6 +270,9 @@ object SharedWithResetUpdate {
            (newValue: JsValue): Either[PatchUpdateValidationException, Update] 
=
     if (capabilities.contains(CapabilityIdentifier.JAMES_SHARES)) {
       serializer.deserializeRights(input = newValue) match {
+        case JsSuccess(value, _) if 
value.rights.get(ANYONE_KEY).exists(_.exists(_ != Right.Post))
+                                  || 
value.rights.get(ANYONE_NEGATIVE_KEY).exists(_.exists(_ != Right.Post)) =>

Review Comment:
   This complicated condition needs refactoring (method / variable extraction)



-- 
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]

Reply via email to