# Plugin Development: List a user’s groups without making a request

**URL:** <https://meta.discourse.org/t/plugin-development-list-a-user-s-groups-without-making-a-request/103710>\
**Category:** Development\
**Created:** [December 7, 2018, 2:52pm UTC](https://meta.discourse.org/t/plugin-development-list-a-user-s-groups-without-making-a-request/103710 "2018-12-07T14:52:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [December 7, 2018, 3:25pm UTC](https://meta.discourse.org/t/plugin-development-list-a-user-s-groups-without-making-a-request/103710/2 "2018-12-07T15:25:13Z")

</div>

You can add custom plugin code to achieve this. Something similar to below code (unverified). Then you can access it like `Discourse.User.current().groups`

```plaintext
  add_to_serializer(:current_user, :groups, false) {
    object.groups.pluck(:name)
  }

```

---

_[View the full topic](https://meta.discourse.org/t/plugin-development-list-a-user-s-groups-without-making-a-request/103710)._
