feat(groups): add fail-closed admission management
This commit is contained in:
@@ -5,9 +5,9 @@ import { db } from "@/lib/database";
|
||||
|
||||
const UI_ACCESSED = "games.minecraft.account-manager.ui.accessed";
|
||||
|
||||
export async function recordAdminEvent(
|
||||
export async function recordAdminSubjectEvent(
|
||||
admin: { email: string | null; name: string | null },
|
||||
targetUserId: string,
|
||||
subject: string,
|
||||
type: string,
|
||||
data: Record<string, unknown>,
|
||||
) {
|
||||
@@ -16,12 +16,21 @@ export async function recordAdminEvent(
|
||||
return recordEvent(db, {
|
||||
type,
|
||||
source: "/web/admin",
|
||||
subject: `user/${targetUserId}`,
|
||||
subject,
|
||||
ipAddress: ipAddress ?? undefined,
|
||||
data: { ...data, adminEmail: admin.email, adminName: admin.name },
|
||||
});
|
||||
}
|
||||
|
||||
export async function recordAdminEvent(
|
||||
admin: { email: string | null; name: string | null },
|
||||
targetUserId: string,
|
||||
type: string,
|
||||
data: Record<string, unknown>,
|
||||
) {
|
||||
return recordAdminSubjectEvent(admin, `user/${targetUserId}`, type, data);
|
||||
}
|
||||
|
||||
export async function recordUserEvent(
|
||||
user: { id: string },
|
||||
type: string,
|
||||
|
||||
Reference in New Issue
Block a user