feat: Audit Logs for Account User Changes (#7405)
- Audit log for user invitations: https://linear.app/chatwoot/issue/CW-1768/invited-a-user-to-the-account - Audit log for change role: https://linear.app/chatwoot/issue/CW-1767/name-or-email-changed-the-role-of-the-user-email-to-agent-or-admin - Audit log for status change: https://linear.app/chatwoot/issue/CW-1766/availability-status-as-events-for-audit-logs Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -49,6 +49,15 @@ class AccountUser < ApplicationRecord
|
||||
::Agents::DestroyJob.perform_later(account, user)
|
||||
end
|
||||
|
||||
def push_event_data
|
||||
{
|
||||
id: id,
|
||||
availability: availability,
|
||||
role: role,
|
||||
user_id: user_id
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def notify_creation
|
||||
@@ -63,3 +72,5 @@ class AccountUser < ApplicationRecord
|
||||
OnlineStatusTracker.set_status(account.id, user.id, availability)
|
||||
end
|
||||
end
|
||||
|
||||
AccountUser.include_mod_with('Audit::AccountUser')
|
||||
|
||||
Reference in New Issue
Block a user