New Rules stay off lists until the person who holds the pen turns on a share link, or the team features one. Uploaded files are readable only by those readers, stripped of location metadata, and deleted with the Rule, draft, or account.
24 lines
613 B
TypeScript
24 lines
613 B
TypeScript
import { logger } from "../logger";
|
|
import { prisma } from "./db";
|
|
|
|
/** Best-effort audit row. Never throws to the caller. */
|
|
export async function logAdminRuleRead(opts: {
|
|
ruleId: string;
|
|
adminEmail: string;
|
|
adminUserId: string | null;
|
|
path: string;
|
|
}): Promise<void> {
|
|
try {
|
|
await prisma.adminRuleReadLog.create({
|
|
data: {
|
|
ruleId: opts.ruleId,
|
|
adminEmail: opts.adminEmail.trim().toLowerCase(),
|
|
adminUserId: opts.adminUserId,
|
|
path: opts.path.slice(0, 500),
|
|
},
|
|
});
|
|
} catch (err) {
|
|
logger.warn("[admin-rule-read] failed to write log", err);
|
|
}
|
|
}
|