Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 10:40:28 +01:00
Allow admin to override multiple submissions setting
Dieser Commit ist enthalten in:
Ursprung
dd706315de
Commit
5784a9db20
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
|
@ -49,7 +49,7 @@ class CustomWizard::Builder
|
||||||
end
|
end
|
||||||
|
|
||||||
def build
|
def build
|
||||||
unless (@wizard.completed? && !@wizard.multiple_submissions) || !@steps || !@wizard.permitted?
|
unless (@wizard.completed? && !@wizard.multiple_submissions && !@wizard.user.admin) || !@steps || !@wizard.permitted?
|
||||||
@steps.each do |s|
|
@steps.each do |s|
|
||||||
@wizard.append_step(s['id']) do |step|
|
@wizard.append_step(s['id']) do |step|
|
||||||
step.title = s['title'] if s['title']
|
step.title = s['title'] if s['title']
|
||||||
|
|
|
@ -71,7 +71,9 @@ end
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_completed?
|
def include_completed?
|
||||||
object.completed? && (!object.respond_to?(:multiple_submissions) || !object.multiple_submissions)
|
object.completed? &&
|
||||||
|
(!object.respond_to?(:multiple_submissions) || !object.multiple_submissions) &&
|
||||||
|
!scope.is_admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
def min_trust
|
def min_trust
|
||||||
|
|
Laden …
In neuem Issue referenzieren