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.
This commit is contained in:
GaryAustin1 authored and GitHub committed 2023-11-20 14:17:58 +11:00
1 parent cba1b07b53
commit 2a4e4442b0
1 file changed
+2 -2
@@ -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
);
```