Function validate_no_rls_policies

Source
pub async fn validate_no_rls_policies(
    client: &Client,
    table_oids: &[Oid],
) -> Result<(), PostgresError>
Expand description

Returns an error if the tables identified by the oid’s have RLS policies which affect the current user. Two checks are made:

  1. Identify which tables, from the provided oid’s, have RLS policies that affecct the user or public.
  2. If there are policies that affect the user, check if the BYPASSRLS attribute is set. If set, the role is unaffected by the policies.