カテゴリをプライベートに変換し、特定のグループにアクセス権を持つユーザーを追加する

他の人が必要とする場合のためにクエリを完了させておきます。

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;

YYY-MM-DD をカットオフ日付に、CATEGORY_ID をカテゴリIDに置き換えてください。
結果には、user_id、username、actions、replies が表示されます。