Hierarchical group membership (groups inside groups)

Here’s an outline for the specific code Adam mentioned previously:

  1. (L36) get all users in the external system
  2. (L37) get all users in Discourse
  3. (L38-39) get all members of the groups in question (global is the “supergroup” in this case)
  4. (L46-78) for each user in the external system, check if they exist in Discourse, and map which groups they’re already part of and need to be added to