FIX: compatibility after allowlist rewording in Discourse

This commit is contained in:
Krzysztof Kotlarek 2020-07-15 09:36:54 +10:00
parent a3a8a2ff74
commit f18cc21793
1 changed files with 8 additions and 1 deletions

View File

@ -200,7 +200,14 @@ after_initialize do
end
end
# 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?