mirror of
https://github.com/discourse/discourse.git
synced 2025-04-16 20:59:06 +08:00
DEV: Raise errors for (black|white)list accesses (#15174)
These have been deprecated for a while
This commit is contained in:
parent
9b5836aa1d
commit
bd10f113e9
@ -238,11 +238,11 @@ class SiteSetting < ActiveRecord::Base
|
|||||||
|
|
||||||
ALLOWLIST_DEPRECATED_SITE_SETTINGS.each_pair do |old_method, new_method|
|
ALLOWLIST_DEPRECATED_SITE_SETTINGS.each_pair do |old_method, new_method|
|
||||||
self.define_singleton_method(old_method) do
|
self.define_singleton_method(old_method) do
|
||||||
Discourse.deprecate("#{old_method.to_s} is deprecated, use the #{new_method.to_s}.", drop_from: "2.6")
|
Discourse.deprecate("#{old_method.to_s} is deprecated, use the #{new_method.to_s}.", drop_from: "2.6", raise_error: true)
|
||||||
send(new_method)
|
send(new_method)
|
||||||
end
|
end
|
||||||
self.define_singleton_method("#{old_method}=") do |args|
|
self.define_singleton_method("#{old_method}=") do |args|
|
||||||
Discourse.deprecate("#{old_method.to_s} is deprecated, use the #{new_method.to_s}.", drop_from: "2.6")
|
Discourse.deprecate("#{old_method.to_s} is deprecated, use the #{new_method.to_s}.", drop_from: "2.6", raise_error: true)
|
||||||
send("#{new_method}=", args)
|
send("#{new_method}=", args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -157,7 +157,7 @@ class Plugin::Instance
|
|||||||
end
|
end
|
||||||
|
|
||||||
def whitelist_staff_user_custom_field(field)
|
def whitelist_staff_user_custom_field(field)
|
||||||
Discourse.deprecate("whitelist_staff_user_custom_field is deprecated, use the allow_staff_user_custom_field.", drop_from: "2.6")
|
Discourse.deprecate("whitelist_staff_user_custom_field is deprecated, use the allow_staff_user_custom_field.", drop_from: "2.6", raise_error: true)
|
||||||
allow_staff_user_custom_field(field)
|
allow_staff_user_custom_field(field)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ class Plugin::Instance
|
|||||||
end
|
end
|
||||||
|
|
||||||
def whitelist_public_user_custom_field(field)
|
def whitelist_public_user_custom_field(field)
|
||||||
Discourse.deprecate("whitelist_public_user_custom_field is deprecated, use the allow_public_user_custom_field.", drop_from: "2.6")
|
Discourse.deprecate("whitelist_public_user_custom_field is deprecated, use the allow_public_user_custom_field.", drop_from: "2.6", raise_error: true)
|
||||||
allow_public_user_custom_field(field)
|
allow_public_user_custom_field(field)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ class Plugin::Instance
|
|||||||
end
|
end
|
||||||
|
|
||||||
def topic_view_post_custom_fields_whitelister(&block)
|
def topic_view_post_custom_fields_whitelister(&block)
|
||||||
Discourse.deprecate("topic_view_post_custom_fields_whitelister is deprecated, use the topic_view_post_custom_fields_allowlister.", drop_from: "2.6")
|
Discourse.deprecate("topic_view_post_custom_fields_whitelister is deprecated, use the topic_view_post_custom_fields_allowlister.", drop_from: "2.6", raise_error: true)
|
||||||
topic_view_post_custom_fields_allowlister(&block)
|
topic_view_post_custom_fields_allowlister(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user