# Comentários de categoria privada expostos por e-mail

**URL:** <https://meta.discourse.org/t/private-category-comments-exposed-via-email/103764>\
**Category:** Bug\
**Created:** [Dezembro 8, 2018, 2:01pm UTC](https://meta.discourse.org/t/private-category-comments-exposed-via-email/103764 "2018-12-08T14:01:52Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)\
**Post date:** [Janeiro 9, 2019, 4:41pm UTC](https://meta.discourse.org/t/private-category-comments-exposed-via-email/103764/17 "2019-01-09T16:41:42Z")

</div>

> [@gerhard](#):
>
> That might be an unintentional side effect of this very old commit.

Indeed it looks like it. The test does not check that the user has been participating in the discussion explicitly (either by personal mention or invitation) nor that – which I guess is our case for the leak – the topic under consideration is in a category restricted to a group (i.e. where `everyone` does not have `see` permission). So I guess the test should return false if the user is staged but not in current participants list and not in any of the authorized groups. It might be enough to:

```ruby
return false if is_staged? && category.read_restricted?

```

---

_[View the full topic](https://meta.discourse.org/t/private-category-comments-exposed-via-email/103764)._
