Q33: document edits and content deletions leave attributed audit records
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb464c3ee4
commit
66de4ef015
9 files changed
+147
-16
No files matched your search
@@ -59,6 +59,14 @@ export class AuditService {
|
||||
);
|
||||
}
|
||||
|
||||
/** Content changes name a real member of the organization as the actor. */
|
||||
requireActor(orgId: string, actorType: "employee" | "agent", actorId: string): void {
|
||||
const table = { employee: "employees", agent: "agents" }[actorType];
|
||||
if (!table) throw new Error(`Unknown actor type "${actorType}".`);
|
||||
const actor = this.db.prepare(`select id from ${table} where id = ? and org_id = ?`).get(actorId, orgId);
|
||||
if (!actor) throw new Error(`No ${actorType} "${actorId}" in this organization.`);
|
||||
}
|
||||
|
||||
createThreadReplay(input: CreateAuditReplayInput): string {
|
||||
const thread = this.requireThread(input.orgId, input.threadId);
|
||||
this.requireEmployee(input.orgId, input.createdByEmployeeId);
|
||||
|
||||
Reference in new issue
Block a user