config_wizard
11/02/2021, 4:26 PMgaryaustin
11/02/2021, 4:30 PMgaryaustin
11/02/2021, 4:34 PMgaryaustin
11/02/2021, 4:35 PMgaryaustin
11/02/2021, 4:42 PMconfig_wizard
11/02/2021, 4:57 PMgaryaustin
11/02/2021, 5:10 PMconfig_wizard
11/02/2021, 5:15 PMgaryaustin
11/02/2021, 5:23 PMgaryaustin
11/02/2021, 5:26 PMgaryaustin
11/02/2021, 5:39 PMconfig_wizard
11/03/2021, 10:03 AMcreate table public.keys (
id uuid references auth.users not null DEFAULT auth.uid(),
inserted_at timestamp with time zone DEFAULT timezone('utc'::text, now()) NOT NULL,
address text,
data text,
primary key (id)
);
alter table public.keys enable row level security;
create policy "Users can insert their own keys."
on public.keys for insert
with check ( auth.uid() = id );
garyaustin
11/03/2021, 12:59 PMconfig_wizard
11/03/2021, 1:20 PMauth.uid() = id
for select/update/delete but for insert just make sure they are authd?config_wizard
11/03/2021, 1:20 PMsql
create table public.keys (
id uuid references auth.users not null DEFAULT auth.uid(),
inserted_at timestamp with time zone DEFAULT timezone('utc'::text, now()) NOT NULL,
address text,
data text,
primary key (id)
);
alter table public.keys enable row level security;
create policy "Users can insert their own keys."
on public.keys for insert
with check ( auth.role() = 'authorized'::text );
create policy "Users can view their own keys."
on public.keys for select
using ( auth.uid() = id );
CREATE POLICY "Users can delete own keys."
ON public.keys for delete
using ( auth.uid() = id );
garyaustin
11/03/2021, 1:47 PMconfig_wizard
11/03/2021, 2:24 PMconfig_wizard
11/03/2021, 2:24 PM