# Badges & Private Communities

**URL:** <https://meta.discourse.org/t/badges-private-communities/157300>\
**Category:** Feature\
**Tags:** badges\
**Created:** [July 9, 2020, 9:47pm UTC](https://meta.discourse.org/t/badges-private-communities/157300 "2020-07-09T21:47:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [July 9, 2020, 11:17pm UTC](https://meta.discourse.org/t/badges-private-communities/157300/2 "2020-07-09T23:17:19Z")

</div>

> [@Mitchelsellers](#):
>
> I understand from prior [discussions in early 201](https://meta.discourse.org/t/badges-dont-work-in-private-restricted-topics/67413/10)7 that badges do not work for groups that are restricted.

The reason for this is that any badges that reference posts run their queries against the `badge_posts` table. That table only includes posts that are in categories that are accessible to all users.

> [@Mitchelsellers](#):
>
> Our group is 99.9% accessible only by those with a role of “Members.” We have a few groups that are open to all for public discussion or help/support. As a paying member group, it would be amazing to be able to recognize the activity within these private groups as of our 1.3+ million posts most of them are inside of those groupings.

Yeah, I can see how that would be a problem. A possible workaround would be to rewrite the badge queries for your site to use the `posts` table instead of the `badge_posts` table. This would cause an issue for users who do not have access to your site’s protected categories if they attempted to view the posts that are associated with your user’s badges, but it sounds like this wouldn’t affect many users on your site. Possibly there are other ways this could be dealt with.

---

_[View the full topic](https://meta.discourse.org/t/badges-private-communities/157300)._
