Link bucket folder to user table #10901
Unanswered
marco-emmanuel-noto
asked this question in
Questions
Replies: 1 comment
-
Bit of a necro post, but might be useful for someone else. The docs have a section on bucket RLS helpers and a bit about access to a subfolder. It might look something like this create policy "Allow users to insert own files"
on storage.objects
for insert
to authenticated
with check (
(storage.foldername(name))[1] = 'user_id'
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all! I'm pretty new to the SQL world, so sorry in advance if this is a trivial question. I'm working on a learning project, and I'm developing a small game where a user can own several characters.
I have a bucket containing images with the following folder structure: user_id/character_id/unique_file_name.
Character's tables are linked to their owner. How can I link the correct folder to the character tale (so a folder where both user_id and character_id are matching)?
Ps: I have Give users access to own folder as RLS for all statements.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions