# A way in client javascript to find if current user is member of private group?

**URL:** https://meta.discourse.org/t/a-way-in-client-javascript-to-find-if-current-user-is-member-of-private-group/104010
**Category:** Development
**Created:** [11 בדצמבר,‏ 2018,‏ 2:37pm UTC](https://meta.discourse.org/t/a-way-in-client-javascript-to-find-if-current-user-is-member-of-private-group/104010 "2018-12-11T14:37:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [11 בדצמבר,‏ 2018,‏ 2:37pm UTC](https://meta.discourse.org/t/a-way-in-client-javascript-to-find-if-current-user-is-member-of-private-group/104010/1 "2018-12-11T14:37:38Z")

</div>

How can I check if a user is a member of a private group in JavaScript?

I’m not confident there’s a solution to this, but I’m asking just in case!

I’m trying to hide a JavaScript-built advertising panel from site donors… that list needs to be confidential.

I suppose I could name a public group innocuously, as there’s a low risk that people will figure out the common factor.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [11 בדצמבר,‏ 2018,‏ 2:46pm UTC](https://meta.discourse.org/t/a-way-in-client-javascript-to-find-if-current-user-is-member-of-private-group/104010/2 "2018-12-11T14:46:21Z")

</div>

For the current user, this will be done soon:

> [@Plugin Development: List a user’s groups without making a request](https://meta.discourse.org/t/plugin-development-list-a-user-s-groups-without-making-a-request/103710/6):
>
> @maja, can you add that to your list? We should always serialize all the group names of the current user (not only the primary group).

This will be enough for you to

> [@merefield](#):
>
> hide a javascript built advertising panel from site donators

and is the exact use case I had in mind.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [11 בדצמבר,‏ 2018,‏ 2:47pm UTC](https://meta.discourse.org/t/a-way-in-client-javascript-to-find-if-current-user-is-member-of-private-group/104010/3 "2018-12-11T14:47:21Z")

</div>


