diff --git a/admin_users.go b/admin_users.go index 7a04caf..1b641ec 100644 --- a/admin_users.go +++ b/admin_users.go @@ -8,6 +8,10 @@ import ( "gorm.io/gorm" ) +func (a *App) audit(operator uint, action, targetType, targetID, metadata string) { + _ = a.db.Create(&AuditLog{OperatorID: operator, Action: action, TargetType: targetType, TargetID: targetID, Metadata: metadata}).Error +} + func defaultPermissions(role string) []string { if role == RolePrivileged { return []string{PermDownload, PermRedeem, PermWebDAV, PermWebDAVConfig}