All blocks

Foundation

Access contract

can(), tenant_ids_with() and is_platform(): one permission contract for policies and SQL modules, over a roles list, a role and permission catalog, an authorization provider or the app's own functions (modules.access.model).

DocsModes:managedadoptcustom
terminal
npx better-supabase sql add access
better-supabase.config.ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  sql: {
    modules: {
      // Required by access; sql add installs them too.
      "updated-at": {},
      tenant: {},
      // Modes: "managed", "adopt", "custom". The default is "managed".
      access: { mode: "managed" },
    },
  },
});