# Theme component: How to get a user's groups (not current user)?

**URL:** https://meta.discourse.org/t/theme-component-how-to-get-a-users-groups-not-current-user/260223
**Category:** Development
**Created:** [April 1, 2023, 6:23pm UTC](https://meta.discourse.org/t/theme-component-how-to-get-a-users-groups-not-current-user/260223 "2023-04-01T18:23:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 1, 2023, 6:23pm UTC](https://meta.discourse.org/t/theme-component-how-to-get-a-users-groups-not-current-user/260223/1 "2023-04-01T18:23:37Z")

</div>

Hi,

I’m working on a theme component to restrict users’ status to groups.

I have difficulty getting a user’s group data (ID) in the following contexts:

- user’s card
- chat messages.

Requesting `<username>.json` is out of the question.  
I did not find any specific route; although it may be okay in a card, it’s not in chat messages.

Is there a way I’m unaware? 🤔

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [April 1, 2023, 11:26pm UTC](https://meta.discourse.org/t/theme-component-how-to-get-a-users-groups-not-current-user/260223/2 "2023-04-01T23:26:17Z")

</div>

i didn’t even think of the chat messages angle because we don’t use that component but now i see how that needs to be accounted for as well with any user status restriction options.

i may end up enabling the user status for all users. but as admin of a sports based forum with a user base made up almost entirely of men of a certain age-demographic (lol), i feel like they will find ways to use that feature to troll others or use it in ways it isn’t intended. one of my mods is already complaining because i enabled the updated avatar user menu. lol
