Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TenancyPartition ¶
TenancyPartition applies tenant and partition filtering to database queries.
Behavior:
- If no claims in context: returns unscoped db (for cross-tenant services)
- If skip tenancy enabled: returns unscoped db (for backend services processing across tenants)
- For internal systems: claims are auto-enriched with secondary claims tenancy data
- tenant_id is a single value; partition_id may be a list (claim.GetPartitionIDs()) so principals that legitimately span multiple partitions (a SACCO operator with access to several branches, an analyst aggregating across groups) see rows from every partition they belong to. Single-partition callers behave as before — the list has one element and the SQL becomes a degenerate IN (?).
- Empty tenant_id will match only records with empty tenant_id (no cross-tenant leakage)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.