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:
Krzysztof Kotlarek
2021-09-06 10:18:51 +10:00
committed by GitHub
parent 9873a942e3
commit f859fd6bde
11 changed files with 78 additions and 3 deletions

View File

@ -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