mirror of
https://github.com/discourse/discourse.git
synced 2025-06-21 00:11:39 +08:00
FEATURE: limits post created edited trigger to a group (#31523)
This commit allows admins to limit the post created/edited trigger execution to a specific post user group. It's for example useful if you want to auto tag all the topics created by member of a specific group.
This commit is contained in:
@ -65,6 +65,9 @@ module DiscourseAutomation
|
||||
next if ignore_group_members && post.user.in_any_groups?(restricted_group_ids)
|
||||
end
|
||||
|
||||
user_group = automation.trigger_field("restricted_user_group")["value"]
|
||||
next if user_group && !post.user.in_any_groups?([user_group])
|
||||
|
||||
ignore_automated = automation.trigger_field("ignore_automated")
|
||||
next if ignore_automated["value"] && post.incoming_email&.is_auto_generated?
|
||||
|
||||
|
Reference in New Issue
Block a user