Skip to content

Instantly share code, notes, and snippets.

@horizon0708
Created April 3, 2021 05:26
Show Gist options
  • Save horizon0708/2e31152c0e0ce18e1b50215b9dee7330 to your computer and use it in GitHub Desktop.
Save horizon0708/2e31152c0e0ce18e1b50215b9dee7330 to your computer and use it in GitHub Desktop.
alter table profiles enable row level security;
create policy "Public profiles are viewable by everyone."
on profiles for select
using ( true );
create policy "Users can insert their own profile."
on profiles for insert
with check ( auth.uid() = id );
create policy "Users can update own profile."
on profiles for update
using ( auth.uid() = id );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment