# Rapport maken over groepslidmaatschap?

**URL:** https://meta.discourse.org/t/making-report-on-group-membership/162174
**Category:** Support
**Created:** [26 augustus 2020 om 20:20 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174 "2020-08-26T20:20:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![stephenz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephenz/32/106448_2.png) [@stephenz](https://meta.discourse.org/u/stephenz)
#### Post date: [26 augustus 2020 om 20:20 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/1 "2020-08-26T20:20:23Z")

</div>

- 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?  
 ![image](https://global.discourse-cdn.com/meta/original/3X/0/4/04fc2b55ca1b802c0a3a112554fc68b724781c10.png)
- 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?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [26 augustus 2020 om 21:59 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/2 "2020-08-26T21:59:20Z")

</div>

There might be a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 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?

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [27 augustus 2020 om 02:40 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/3 "2020-08-27T02:40:28Z")

</div>

@michebs maybe something you can assist with?

---

<div class="post-metadata">

### Author: ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)
#### Post date: [27 augustus 2020 om 08:39 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/4 "2020-08-27T08:39:40Z")

</div>

> [@codinghorror](#):
>
> A list of each group, and the members in each group?

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
> 
> ```

---

<div class="post-metadata">

### Author: ![stephenz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephenz/32/106448_2.png) [@stephenz](https://meta.discourse.org/u/stephenz)
#### Post date: [27 augustus 2020 om 20:27 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/5 "2020-08-27T20:27:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [7 september 2020 om 03:36 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/6 "2020-09-07T03:36:38Z")

</div>

> [@stephenz](#):
>
> I haven’t used this Data Query Explorer before. Is this something I’ll find at the CLI of my instance?

It is a plugin. See [Discourse Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566)

> [@stephenz](#):
>
> By the looks of it, it seems a bit similar to SQL and Influx queries

It’s SQL.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [7 oktober 2020 om 03:40 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/7 "2020-10-07T03:40:35Z")

</div>

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