From 2a4e4442b0ae9dfc65d4e40ff3b95a4a11cc3fe7 Mon Sep 17 00:00:00 2001 From: GaryAustin1 <54564956+GaryAustin1@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:17:58 -0600 Subject: [PATCH] Update access-control.mdx to fix missing () and cast to text (#19083) Using storage.foldername(name)[1] requires this format: (storage.foldername(name))[1] Also comparing the result to auth.uid() requires a cast. I showed using auth.uid()::text as the example. --- apps/docs/pages/guides/storage/security/access-control.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/docs/pages/guides/storage/security/access-control.mdx b/apps/docs/pages/guides/storage/security/access-control.mdx index 5ab691f8363..ccaa9aa2712 100644 --- a/apps/docs/pages/guides/storage/security/access-control.mdx +++ b/apps/docs/pages/guides/storage/security/access-control.mdx @@ -59,7 +59,7 @@ for insert to authenticated with check ( bucket_id = 'my_bucket_id' and - storage.foldername(name)[1] = 'private' + (storage.foldername(name))[1] = 'private' ); ``` @@ -72,7 +72,7 @@ for insert to authenticated with check ( bucket_id = 'my_bucket_id' and - storage.foldername(name)[1] = auth.uid() + (storage.foldername(name))[1] = auth.uid()::text ); ```