feat: record admin and redeem audit events
This commit is contained in:
@@ -8,6 +8,10 @@ import (
|
|||||||
"gorm.io/gorm"
|
"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 {
|
func defaultPermissions(role string) []string {
|
||||||
if role == RolePrivileged {
|
if role == RolePrivileged {
|
||||||
return []string{PermDownload, PermRedeem, PermWebDAV, PermWebDAVConfig}
|
return []string{PermDownload, PermRedeem, PermWebDAV, PermWebDAVConfig}
|
||||||
|
|||||||
Reference in New Issue
Block a user