Row-level security adds per-row conditions to ordinary table privileges. Enable it on the table, then define policies for the intended roles and commands. With row security enabled and no matching policy, normal access is denied by default. The table owner normally bypasses policies, and superusers or BYPASSRLS roles can also bypass them.
USING controls existing rows a role can see or modify. WITH CHECK controls new values created by INSERT or UPDATE. A policy that only filters reads doesn't automatically define every write boundary. Test with a nonowner role and attempt both permitted and forbidden tenant operations.
A tenant setting is context, not authentication. A service must derive it from trusted identity and scope it to the transaction, especially with transaction pooling. The exercise uses a local custom setting to demonstrate policy behavior; it doesn't claim that clients may choose their own authorization context.
Test a tenant filter under a nonowner role so setup privileges can't bypass it.