Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-30 12:31:10 +01:00
17 Zeilen
373 B
Ruby
17 Zeilen
373 B
Ruby
# frozen_string_literal: true
|
|
|
|
module CustomWizardGuardian
|
|
def can_edit_topic?(topic)
|
|
wizard_can_edit_topic?(topic) || super
|
|
end
|
|
|
|
def wizard_can_edit_topic?(topic)
|
|
created_by_wizard = !!topic.wizard_submission_id
|
|
(
|
|
is_my_own?(topic) &&
|
|
created_by_wizard &&
|
|
can_see_topic?(topic) &&
|
|
can_create_post_on_topic?(topic)
|
|
)
|
|
end
|
|
end
|