Skip to content

Conversation

@kimsehwan96
Copy link
Contributor

@kimsehwan96 kimsehwan96 commented Jan 27, 2026

What changes were proposed in this pull request?

Added missing updateUserStoreVersion() call in XUserMgr.createOrDeleteXGroupUserList().

Without this fix, when user-group membership changes in LDAP (e.g., a user is added to or removed from a group), the
UserSync successfully updates the x_group_users table in Ranger Admin, but the RangerUserStore version remains unchanged.

Other similar methods like createXGroupUserFromMap() and createOrUpdateXGroups() already call updateUserStoreVersion() after modifying user/group data.

How was this patch tested?

  • Built locally and deployed to a test environment
  • Configured UserSync with LDAP source / Added user to a group in LDAP / Verified userstore version increments after sync

@@ -2964,6 +2964,9 @@ public int createOrDeleteXGroupUserList(List<GroupUserInfo> groupUserInfoList) {

updatedGroups = groupUserInfoList.size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at implementation of xGroupUserService.createOrDeleteXGroupUsers(), no update might be performed in some scenarios - depending on contents of parameter groupUserInfo. I suggest updating this method to return true when it performs any update and use that to increment updatedGroups.

Copy link
Contributor Author

@kimsehwan96 kimsehwan96 Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mneethiraj Changed xGroupUserService.createOrDeleteXGroupUsers() method to return boolean. If the method early returned with no actual updates then return false and If actual update was performed then return true.

And increment updatedGroups and return its count as createOrDeleteGroupUserList return and if at lease one update was really performed then update user store version.

Alos I added test code about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, returning boolean with name createOrDeleteXGroupUsers might be little awkward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants