mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:55:46 +08:00
FEATURE: allow plugins to extend Groups (#14216)
* add_permitted_group_param API for plugins * add groups-interaction-custom-options outlet * custom search can use custom group scope
This commit is contained in:

committed by
GitHub

parent
9873a942e3
commit
f859fd6bde
@ -369,6 +369,17 @@ class Plugin::Instance
|
||||
end
|
||||
end
|
||||
|
||||
# Add a permitted_param to Group, respecting if the plugin is enabled
|
||||
# Used in GroupsController#update and Admin::GroupsController#create
|
||||
def register_group_param(param)
|
||||
DiscoursePluginRegistry.register_group_param(param, self)
|
||||
end
|
||||
|
||||
# Add a custom scopes for search to Group, respecting if the plugin is enabled
|
||||
def register_group_scope_for_search(scope_name)
|
||||
DiscoursePluginRegistry.register_group_scope_for_search(scope_name, self)
|
||||
end
|
||||
|
||||
# Add validation method but check that the plugin is enabled
|
||||
def validate(klass, name, &block)
|
||||
klass = klass.to_s.classify.constantize
|
||||
|
Reference in New Issue
Block a user