AuditManager
Overview
AuditManager is the resource audit management module in NocoBase, used to register resource interfaces that need to be audited.
Basic Usage
Class Methods
setLogger()
Sets the output method for audit logs.
Signature
setLogger(logger: AuditLogger)
Type
registerAction()
Registers a resource action to be audited.
Signature
registerAction(action: Action)
Type
Details
Several writing styles are supported:
- Apply to all resources
- Apply to all actions of a specific resource
resource:*
- Apply to a specific action of a specific resource
resource:action
- Supports passing custom
getMetaData,getUserInfo, andgetSourceAndTargetmethods for the action
When registered interfaces overlap, the more specific registration method has higher priority. For example:
-
registerActions('create') -
registerAction({ name: 'user:*', getMetaData }) -
registerAction({ name: 'user:create', getMetaData })
For the user:create interface, 3 will take effect.
registerActions()
Registers multiple resource actions to be audited.
Signature
registerActions(actions: Action[])

