At sign-up I add a
field (which is an integer) to the new user's
, and I need to use this in row-level security policy.
I can't figure out the syntax for accessing this in the policy statement. I thought it would be something like this:
ALTER POLICY "Enable tenant-based access" ON "public"."test" USING (tenant_id = (auth.jwt().app_metadata -> 'tenant_id'::integer));
But I get a syntax error. Any ideas? Thanks!