[
{
"schemaname": "public",
"tablename": "businesses",
"policyname": "allow authenticated inserts with owner",
"permissive": "PERMISSIVE",
"roles": "{authenticated}",
"cmd": "INSERT",
"qual": null,
"with_check": "(owner_id = ( SELECT auth.uid() AS uid))"
},
{
"schemaname": "public",
"tablename": "businesses",
"policyname": "businesses_select",
"permissive": "PERMISSIVE",
"roles": "{public}",
"cmd": "SELECT",
"qual": "(id = ( SELECT profiles.business_id\n FROM profiles\n WHERE (profiles.id = auth.uid())))",
"with_check": null
},
{
"schemaname": "public",
"tablename": "businesses",
"policyname": "businesses_update",
"permissive": "PERMISSIVE",
"roles": "{public}",
"cmd": "UPDATE",
"qual": "(id = ( SELECT profiles.business_id\n FROM profiles\n WHERE ((profiles.id = auth.uid()) AND (profiles.role = 'owner'::text))))",
"with_check": "(id = ( SELECT profiles.business_id\n FROM profiles\n WHERE ((profiles.id = auth.uid()) AND (profiles.role = 'owner'::text))))"
}
]
[
{
"schemaname": "public",
"tablename": "businesses",
"policyname": "allow authenticated inserts with owner",
"permissive": "PERMISSIVE",
"roles": "{authenticated}",
"cmd": "INSERT",
"qual": null,
"with_check": "(owner_id = ( SELECT auth.uid() AS uid))"
},
{
"schemaname": "public",
"tablename": "businesses",
"policyname": "businesses_select",
"permissive": "PERMISSIVE",
"roles": "{public}",
"cmd": "SELECT",
"qual": "(id = ( SELECT profiles.business_id\n FROM profiles\n WHERE (profiles.id = auth.uid())))",
"with_check": null
},
{
"schemaname": "public",
"tablename": "businesses",
"policyname": "businesses_update",
"permissive": "PERMISSIVE",
"roles": "{public}",
"cmd": "UPDATE",
"qual": "(id = ( SELECT profiles.business_id\n FROM profiles\n WHERE ((profiles.id = auth.uid()) AND (profiles.role = 'owner'::text))))",
"with_check": "(id = ( SELECT profiles.business_id\n FROM profiles\n WHERE ((profiles.id = auth.uid()) AND (profiles.role = 'owner'::text))))"
}
]