mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
DEV: Allow plugins to mark user custom fields as editable only by staff
This adds a staff_only parameter to the register_editable_user_custom_field API. The default is false, to maintain backwards compatibility.
This commit is contained in:
@ -141,9 +141,9 @@ class Plugin::Instance
|
||||
end
|
||||
end
|
||||
|
||||
def register_editable_user_custom_field(field)
|
||||
def register_editable_user_custom_field(field, staff_only: false)
|
||||
reloadable_patch do |plugin|
|
||||
::User.register_plugin_editable_user_custom_field(field, plugin) # plugin.enabled? is checked at runtime
|
||||
::User.register_plugin_editable_user_custom_field(field, plugin, staff_only: staff_only) # plugin.enabled? is checked at runtime
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user