DEV: Trigger an event when a user is granted admin or moderation. (#17663)

This commit is contained in:
Roman Rizzi 2022-07-26 10:20:34 -03:00 committed by GitHub
parent 517e2f7dc4
commit 5a0480efd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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!