mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 04:29:29 +00:00
feat(audit): change audit log action to string at db level and split file/folder actions
This commit is contained in:
@@ -9,7 +9,9 @@ import {
|
||||
import { paginationParamsSchema } from '@shumai/dtos'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
import { notificationService } from '@shumai/core/src/notification/notification'
|
||||
import { NotificationType } from '@shumai/db'
|
||||
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { NotificationType, AuditAction } from '@shumai/db'
|
||||
import { s3Service, verifyLocalUrlSignature } from '@shumai/core/src/s3/s3'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
|
||||
@@ -108,6 +110,15 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
assetId: req.fileId,
|
||||
taskId: taskId,
|
||||
})
|
||||
|
||||
const context = await assetService.getAssetContext(req.fileId)
|
||||
await auditLogService.logAction({
|
||||
action: AuditAction.file_create,
|
||||
teamId: teamId,
|
||||
userId: user.id,
|
||||
projectId: context.projectId,
|
||||
itemId: req.fileId,
|
||||
})
|
||||
}
|
||||
|
||||
return c.json({ success: true })
|
||||
|
||||
Reference in New Issue
Block a user