FIX: properly ban non human users from draft system

Previously we had a partial fix in place where non human users
were not allowed draft sequences, this left edges around where non
human users asked for drafts yet had none.

For example system could already have a few drafts in place.

This also removes and extensibility point we added that is not in use
This commit is contained in:
Sam Saffron
2020-05-26 10:07:00 +10:00
parent 979093787f
commit fc97f7e0e7
5 changed files with 31 additions and 23 deletions

View File

@ -405,15 +405,6 @@ class Plugin::Instance
SeedFu.fixture_paths.concat(paths)
end
# Applies to all sites in a multisite environment. Block is not called if
# plugin is not enabled. Block is called with `user_id` and has to return a
# boolean based on whether the given `user_id` should be ignored.
def register_ignore_draft_sequence_callback(&block)
reloadable_patch do |plugin|
::DraftSequence.plugin_ignore_draft_sequence_callbacks[plugin] = block
end
end
def listen_for(event_name)
return unless self.respond_to?(event_name)
DiscourseEvent.on(event_name, &self.method(event_name))