|
ORE Studio 0.0.4
|
Manages party context for party-isolated database operations. More...
#include <party_context.hpp>

Static Public Member Functions | |
| static context | with_party (const context &ctx, const utility::uuid::tenant_id &tenant, const boost::uuids::uuid &party, const std::string &actor="") |
| Creates a new context with tenant and party isolation. | |
Manages party context for party-isolated database operations.
Party isolation is a second layer of RLS on top of tenant isolation. Tables with a party_id column use AS RESTRICTIVE FOR SELECT policies that filter rows to those visible to the current party (and its descendants in the party hierarchy).
Use with_party() to derive a new context that sets app.visible_party_ids on every connection, enabling all party-isolated reads and writes. Publishers must call this once per party before a batch of DML.
|
static |
Creates a new context with tenant and party isolation.
Queries ores_refdata_visible_party_ids_fn to compute the visible party set (the given party and all its descendants), then returns a new context that sets app.visible_party_ids on each connection acquire.
| ctx | Source context (must already have tenant context set). |
| tenant | Tenant ID. |
| party | Party ID whose subtree should be visible. |
| actor | Optional actor name for audit trail. |
| std::runtime_error | if the party is not found in the tenant. |