RGJ
(Richard - Communiteq)
4월 22, 2025, 10:03오전
1
When “Everyone” is added to discourse_templates_groups_allowed_private_templates, the functionality breaks for everyone except staff.
So “Everyone, trust_level_0” does not work, while “trust_level_0” does work.
Culprit:
def can_use_private_templates?
return false unless SiteSetting.discourse_templates_enable_private_templates
return false unless SiteSetting.tagging_enabled
return false if SiteSetting.discourse_templates_private_templates_tags.blank?
return true if guardian.is_staff?
allowed_groups_ids =
SiteSetting.discourse_templates_groups_allowed_private_templates&.split("|")&.map(&:to_i)
allowed_groups_ids.any? do |group_id|
return false if group_id == 0
# the user can use templates if belongs to at least one of the allowed groups
GroupUser.exists?(group_id: group_id, user_id: self.id)
end
end
return false if group_id == 0
3개의 좋아요
Moin
4월 22, 2025, 10:29오전
2
I think the problem with ‘everyone’ and templates has already been reported in "everyone" group unable to see private templates
1개의 좋아요
RGJ
(Richard - Communiteq)
4월 22, 2025, 10:42오전
3
Yes, I see it now, thanks.
I misread that bug, I thought that simply “everyone” did not work, I did not realize it broke it for all other added groups as well.
Reported 1.5 years ago
4개의 좋아요
Thank you for reporting this bug. It was fixed in this PR:
https://github.com/discourse/discourse-templates/pull/103
3개의 좋아요