feat: record admin and redeem audit events

This commit is contained in:
OpenClaw Agent
2026-09-17 02:20:54 +08:00
parent 5fbf9fe252
commit c79381555a
+4
View File
@@ -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}