fix: AuthBook 变动审计

pull/6678/head
xinwen 3 years ago committed by Jiangjie.Bai
parent f9218584f4
commit 5e8a55f949

@ -11,7 +11,7 @@ from django.utils.translation import ugettext_lazy as _
from rest_framework.renderers import JSONRenderer
from rest_framework.request import Request
from assets.models import Asset
from assets.models import Asset, SystemUser
from common.const.signals import POST_ADD, POST_REMOVE, POST_CLEAR
from jumpserver.utils import current_request
from common.utils import get_request_ip, get_logger, get_syslogger
@ -38,7 +38,7 @@ MODELS_NEED_RECORD = (
'LoginACL', 'LoginAssetACL',
# assets
'Asset', 'Node', 'AdminUser', 'SystemUser', 'Domain', 'Gateway', 'CommandFilterRule',
'CommandFilter', 'Platform',
'CommandFilter', 'Platform', 'AuthBook',
# applications
'Application',
# orgs
@ -106,6 +106,11 @@ M2M_NEED_RECORD = {
_('{User} *JOINED* {UserGroup}'),
_('{User} *LEFT* {UserGroup}')
),
SystemUser.assets.through._meta.object_name: (
_('Asset and SystemUser'),
_('{Asset} *ADD* {SystemUser}'),
_('{Asset} *REMOVE* {SystemUser}')
),
Asset.nodes.through._meta.object_name: (
_('Node and Asset'),
_('{Node} *ADD* {Asset}'),

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save