INNER CODE UNIT · TypeScript

applyBuiltInResourceDefaults

colyseus/colyseus · packages/admin/src-backend/index.ts:286

function applyBuiltInResourceDefaults(
  resources: Record<string, ResourceDefinition>,
  tables: Record<string, any>,
): void {
  const builtIns: Record<string, () => Partial<ResourceDefinition>> = {
    userNotes: () => ({
      create: {
        defaults: ({ operatorId }) => ({ authorId: operatorId }),
      },
    }),
    // Audit log — append-only by contract. Writes are denied for
    // *everyone* (including admin) so a compromised account can't
    // tamper with the record retroactively; pruning happens out-of-
    // band (cron / SQL job). Reads are admin-only because the payload
    // can contain sensitive before/after row data.
    adminAudit: () => ({
      label: 'Audit log',
      icon: 'file-text',

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…