Skip to content

Instantly share code, notes, and snippets.

@allipiopereira
Created January 22, 2024 15:03
Show Gist options
  • Save allipiopereira/d7b01632d865e82e85c926e4d5772b14 to your computer and use it in GitHub Desktop.
Save allipiopereira/d7b01632d865e82e85c926e4d5772b14 to your computer and use it in GitHub Desktop.
policies users table - Auth Supabase
create policy "Public notes are viewable by everyone." on users
for select using (true);
create policy "Users can insert their own notes." on users
for insert with check (auth.uid() = id);
create policy "Users can update their own notes." on users
for update using (auth.uid() = id);
-- Policy to allow users to delete their own notes
create policy "Users can delete their own notes." on users
for delete using (auth.uid() = id);
@allipiopereira
Copy link
Author

create policies: select, insert, update and delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment