You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "quantranhong1999 (via GitHub)" <gi...@apache.org> on 2023/03/06 05:51:36 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1473: JAMES-3885 Delegation should be supported when using LDAP

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: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org