Making report on group membership?

  • We use Discourse for our volunteer run, member based organisation and I’d like to know if there is a quick way of getting a report of group membership.
  • We currently have about 60 users and 20 groups as we use our Discourse to help run our organisation, especially where the shortfalls of email emerge in group discussions.

I find some of interfacing with Discourse permissions a bit limiting sometimes. I come from IT sysadmin, so I’m used to being able to nest groups in things like Active Directory, but I hope I’m not projecting too much of that onto Discourse, as they are obviously very different things.

  • I’m hoping to easily produce a report that has a list of who is in what group to help me keep our categories organised and consume less time.
    • I know this will only be possible if I keep the group membership up to date, but this is the best way I’m aware of.
  • I assume that group nesting is not possible?

  • What is the rationale behind having the mechanism that throws this error?
  • I understand that you wouldn’t want a child category to be accessible when the parent category is not(that is fine for a shared network drive, but it does not make sense in Discourse)
  • But could you possibly change it to an alert that the group in question is not accessible by the parent category, and by continuing with this change, they will be added with the minimum needed(or a selectable level) permissions?
3 Likes

There might be a Data Explorer query which could surface that info for you? A list of each group, and the members in each group? That’s what you’re looking for?

2 Likes

@michebs maybe something you can assist with?

2 Likes

If this information is what you need, these queries can help you.

LIST NAME GROUPS
SELECT 
    g.name group_name,
    user_count
FROM groups g 
ORDER BY g.name ASC
LIST GROUP AND MEMBERS
-- [params]
-- string :group_name

SELECT 
    g.name group_name,
    u.username user_name,	
    gu.owner group_owner
FROM group_users gu 
LEFT JOIN groups g ON gu.group_id = g.id
LEFT JOIN users u ON gu.user_id = u.id
WHERE user_id > 0
    AND g.name LIKE '%'||:group_name||'%'
ORDER BY g.name ASC, gu.owner DESC
LIST ALL GROUPS AND MEMBERS
SELECT 
    g.name group_name,
    u.username user_name,	
    gu.owner group_owner
FROM group_users gu 
LEFT JOIN groups g ON gu.group_id = g.id
LEFT JOIN users u ON gu.user_id = u.id
WHERE user_id > 0
ORDER BY g.name ASC, gu.owner DESC
5 Likes

Thanks @codinghorror @michebs.

I haven’t used this Data Query Explorer before. Is this something I’ll find at the CLI of my instance?

By the looks of it, it seems a bit similar to SQL and Influx queries

1 Like

It is a plugin. See Data Explorer Plugin

It’s SQL.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.