quantranhong1999 commented on code in PR #1473:
URL: https://github.com/apache/james-project/pull/1473#discussion_r1125947189


##########
server/data/data-cassandra/src/main/java/org/apache/james/user/cassandra/CassandraUsersDAO.java:
##########
@@ -212,11 +210,7 @@ public Mono<Void> addAuthorizedUsers(Username baseUser, 
Username userWithAccess)
             .setString(NAME, userWithAccess.asString())
             .setSet(DELEGATED_USERS, ImmutableSet.of(baseUser.asString()), 
String.class));
 
-        return getUserByNameReactive(userWithAccess).hasElement()
-            .filter(FunctionalUtils.identityPredicate())
-            .map(existAuthorizedUser -> (Statement) batchBuilder.build())
-            .switchIfEmpty(Mono.just(addAuthorizedStatement))
-            .flatMap(executor::executeVoid);
+        return executor.executeVoid(batchBuilder.build());

Review Comment:
   I explained it in the commit message:
   
   GIVEN there are no users in user table
   Behavior before: only delegatees source is modified, leaving the delegator 
source is not consistent with delegatees source
   
   We have LDAP user repository edge case for delegation where LDAP does not 
depend on `user` table (therefore empty table), so we need to be more lenient 
managing delegations for this case.



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