mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 08:38:26 -04:00
Audit when user permissions are changed
I've used the term "admin_roles" in the event data to try and show that these are not the permissions we store in the DB. This is the name we use for the abstracted form of permissions in the Admin app. While we could store the DB permissions, that would be a bit more effort and arguably it's clearer to keep the event data consistent with the options the user actually saw / chose.
This commit is contained in:
@@ -8,6 +8,7 @@ EVENT_SCHEMAS = {
|
||||
"update_user_mobile_number": {"user_id", "updated_by_id", "original_mobile_number", "new_mobile_number"},
|
||||
"remove_user_from_service": {"user_id", "removed_by_id", "service_id"},
|
||||
"add_user_to_service": {"user_id", "invited_by_id", "service_id"},
|
||||
"set_user_permissions": {"user_id", "service_id", "original_admin_roles", "new_admin_roles", "set_by_id"},
|
||||
"archive_user": {"user_id", "archived_by_id"},
|
||||
"change_broadcast_account_type": {"service_id", "changed_by_id", "service_mode", "broadcast_channel", "provider_restriction"}, # noqa: E501 (length)
|
||||
"archive_service": {"service_id", "archived_by_id"},
|
||||
@@ -36,6 +37,10 @@ def create_add_user_to_service_event(**kwargs):
|
||||
_send_event('add_user_to_service', **kwargs)
|
||||
|
||||
|
||||
def create_set_user_permissions_event(**kwargs):
|
||||
_send_event('set_user_permissions', **kwargs)
|
||||
|
||||
|
||||
def create_archive_user_event(**kwargs):
|
||||
_send_event('archive_user', **kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user