Optionalname: stringOptional name for the policy. If not provided, a name will be auto-generated based on the table, operation, and policy type.
A PolicyBuilder instance for fluent API chaining
// Simple user ownership policy with explicit name
const p = policy('user_documents')
.on('documents')
.read()
.when(column('user_id').isOwner());
// Auto-generated name -> "documents_select_policy"
const p = policy()
.on('documents')
.read()
.when(column('user_id').isOwner());
// Auto-generated restrictive -> "documents_all_restrictive_policy"
const p = policy()
.on('documents')
.all()
.restrictive()
.when(column('tenant_id').belongsToTenant());
Create a new policy builder