From f18cc217934d01574929657ba4d8f285c81fc185 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Wed, 15 Jul 2020 09:36:54 +1000 Subject: [PATCH] FIX: compatibility after allowlist rewording in Discourse --- plugin.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 4728b07..5b82679 100644 --- a/plugin.rb +++ b/plugin.rb @@ -200,7 +200,14 @@ after_initialize do end end - whitelist_staff_user_custom_field(COUNT_FIELD) + + # TODO Drop after Discourse 2.6.0 release + if respond_to?(:whitelist_staff_user_custom_field) + whitelist_staff_user_custom_field(COUNT_FIELD) + else + allow_staff_user_custom_field(COUNT_FIELD) + end + add_to_class(Guardian, :can_delete_user_notes?) do (SiteSetting.user_notes_moderators_delete? && user.staff?) || user.admin?