mirror of
https://ghfast.top/https://github.com/paviliondev/discourse-journal.git
synced 2026-07-16 11:46:27 +08:00
16 lines
313 B
Ruby
16 lines
313 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseJournal
|
|
module PostCreatorExtension
|
|
def valid?
|
|
valid = super
|
|
return false if !valid
|
|
|
|
if @topic&.journal && post_is_journal_entry?(@post)
|
|
guardian.can_create_entry_on_topic?(@topic)
|
|
else
|
|
valid
|
|
end
|
|
end
|
|
end
|
|
end
|