It looks like this is the same known issue that causes problems with templates.
everyone-group-unable-to-see-private-templates
In this case, the ai-bot options appear, but the bot simply never responds.
It looks like this is the same known issue that causes problems with templates.
everyone-group-unable-to-see-private-templates
In this case, the ai-bot options appear, but the bot simply never responds.
Thanks for searching for prior issues!
![]()
I think the same applies here:
You can not give anonymous users access to the chat bot, so using trust_level_0 is an effective solution for your use case. ![]()
@Roman reading through the code in Discourse I think this works now.
Is it time to close this off and remove the backwards compat code?
It’s a bit tricky. I originally added the everyone option because we wanted to let anonymous users see gists. Every feature has its own rules so I don’t think setting a Persona’s allowed groups to that will make the feature available to everyone.
This is still an issue. If “AI bot allowed groups” is set to everyone, the bot does not respond.
I think the bug is here
return false if (SiteSetting.ai_bot_allowed_groups_map & post.user.group_ids).blank?
If the setting is everyone then this returns false, since 0 is not in post.user.group_ids
The correct pattern is !user.in_any_groups?(SiteSetting.ai_bot_allowed_groups_map)
which has a special case for everyone:
def in_any_groups?(group_ids)
group_ids.include?(Group::AUTO_GROUPS[:everyone]) ||
(is_system_user? && (Group.auto_groups_between(:admins, :trust_level_4) & group_ids).any?) ||
(group_ids & belonging_to_group_ids).any?
end
해당 설정에서 “everyone”(모든 사용자)을 선택할 수 없도록 하는 것이 합리적인가요? DEV: restrict everyone on whisper groups via a new disallowed_groups attr - Pull Request #37515 - discourse/discourse - GitHub 에서처럼 처리하는 방식과 유사합니다.
응, 그거 제거해야 해… @martin이 이거 정리할 거라고 목록에 올려놨는데, 시간이 좀 걸릴 수 있어.
@martin 이 이슈를 닫을까요? 현재 버전만 패치할까요?
이를 수행하기 위한 작은 PR이며, 이 버그도 함께 수정합니다: