# Преобразовать категорию в приватную и добавить пользователей в конкретную группу с доступом

**URL:** <https://meta.discourse.org/t/convert-a-category-to-private-and-add-users-to-a-specific-group-with-access/290463>\
**Category:** Product Support\
**Created:** [04.Январь.2024 03:11:52 UTC](https://meta.discourse.org/t/convert-a-category-to-private-and-add-users-to-a-specific-group-with-access/290463 "2024-01-04T03:11:52Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Crius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crius/32/317214_2.png) [@Crius](https://meta.discourse.org/u/Crius)\
**Post date:** [16.Январь.2024 11:15:56 UTC](https://meta.discourse.org/t/convert-a-category-to-private-and-add-users-to-a-specific-group-with-access/290463/8 "2024-01-16T11:15:56Z")

</div>

Оставьте этот запрос на случай, если он понадобится другим:

```plaintext
select ua.user_id, u.username, sum(action_type) actions, sum(case action_type when 5 then 1 else 0 end) replies from user_actions ua 
join users u on u.id = ua.user_id
join topics t on target_topic_id = t.id
where ua.created_at > 'YYYY-MM-DD'::date and t.category_id = CATEGORY_ID
group by ua.user_id, u.username;

```

Просто замените `YYYY-MM-DD` на вашу дату отсечения, а `CATEGORY_ID` — на идентификатор вашей категории.

В результате будут отображены user\_id, username, actions и replies.

---

_[View the full topic](https://meta.discourse.org/t/convert-a-category-to-private-and-add-users-to-a-specific-group-with-access/290463)._
