You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for #40: Allow UserGroup services to work for non-local users
JIDs on domains other than the local domain can be in groups. This commit adds support for that in the UserGroups endpoints, with the exception of an endpoint that would make the code iterate over all groups in the system.
if (jid.getDomain().equals(XMPPServer.getInstance().getServerInfo().getXMPPDomain())) {
407
+
username = jid.getNode();
408
+
} else {
409
+
// Implementing this would require us to iterate over all groups, which is a performance nightmare.
410
+
thrownewServiceException("This service cannot be used for non-local users.", username, ExceptionType.GROUP_NOT_FOUND, Response.Status.INTERNAL_SERVER_ERROR);
411
+
}
412
+
}
404
413
Useruser = getAndCheckUser(username);
405
414
Collection<Group> groups = GroupManager.getInstance().getGroups(user);
406
415
List<String> groupNames = newArrayList<String>();
@@ -438,7 +447,7 @@ public void addUserToGroups(String username, UserGroupsEntity userGroupsEntity)
0 commit comments