docs: def get_user_groups(user):
      """Return the set of associated TenantGroups for the given user."""
      if user.is_active and user.is_authenticated():
          if user.is_superuser:
              return TenantGroup.objects.all()
          else:
              return TenantGroup.objects.filter(tenantrole__user=user).distinct()
      else:
          return TenantGroup.objects.none()