From 5a0480efd7015ffc2f00d60aed3d093573c669d9 Mon Sep 17 00:00:00 2001 From: Roman Rizzi Date: Tue, 26 Jul 2022 10:20:34 -0300 Subject: [PATCH] DEV: Trigger an event when a user is granted admin or moderation. (#17663) --- app/models/concerns/roleable.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/concerns/roleable.rb b/app/models/concerns/roleable.rb index 4a9a6be3ddb..aca850a10f7 100644 --- a/app/models/concerns/roleable.rb +++ b/app/models/concerns/roleable.rb @@ -35,6 +35,7 @@ module Roleable auto_approve_user enqueue_staff_welcome_message(:moderator) set_default_notification_levels(:moderators) + DiscourseEvent.trigger(:staff_granted, self, :moderator) end def revoke_moderation! @@ -47,6 +48,7 @@ module Roleable auto_approve_user enqueue_staff_welcome_message(:admin) set_default_notification_levels(:admins) + DiscourseEvent.trigger(:staff_granted, self, :admin) end def revoke_admin!