Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 11:52:54 +01:00
Check if admin when including wizard required on the site serializer
Dieser Commit ist enthalten in:
Ursprung
68b6e34b55
Commit
85c436c59e
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
|
@ -109,4 +109,10 @@ after_initialize do
|
|||
end
|
||||
|
||||
add_to_serializer(:current_user, :redirect_to_wizard) { object.custom_fields['redirect_to_wizard'] }
|
||||
|
||||
SiteSerializer.class_eval do
|
||||
def include_wizard_required?
|
||||
scope.is_admin? && Wizard.user_requires_completion?(scope.user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Laden …
In neuem Issue referenzieren