landingpage
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- Allow anonymous uploads into the public 'gallery' bucket.
|
||||
-- The bucket is public, so direct object GETs bypass RLS for display.
|
||||
-- These policies only grant INSERT to anon for this bucket.
|
||||
|
||||
ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
DROP POLICY IF EXISTS storage_objects_gallery_insert ON storage.objects;
|
||||
|
||||
CREATE POLICY storage_objects_gallery_insert ON storage.objects
|
||||
FOR INSERT TO anon
|
||||
WITH CHECK (bucket = 'gallery');
|
||||
|
||||
GRANT INSERT ON storage.objects TO anon;
|
||||
GRANT USAGE ON SCHEMA storage TO anon;
|
||||
@@ -0,0 +1,9 @@
|
||||
-- Allow anon to read (and satisfy INSERT ... RETURNING) rows in the public
|
||||
-- 'gallery' bucket. Reads of object URLs from a public bucket already bypass
|
||||
-- RLS; this policy only unblocks the row returned by the upload INSERT.
|
||||
|
||||
CREATE POLICY storage_objects_gallery_select ON storage.objects
|
||||
FOR SELECT TO anon
|
||||
USING (bucket = 'gallery');
|
||||
|
||||
GRANT SELECT ON storage.objects TO anon;
|
||||
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE IF NOT EXISTS public.discount_claims (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
name text NOT NULL,
|
||||
phone text NOT NULL,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
ALTER TABLE public.discount_claims ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY discount_claims_insert ON public.discount_claims
|
||||
FOR INSERT TO anon
|
||||
WITH CHECK (true);
|
||||
|
||||
GRANT INSERT ON public.discount_claims TO anon;
|
||||
GRANT USAGE ON SCHEMA public TO anon;
|
||||
@@ -0,0 +1,7 @@
|
||||
DROP POLICY IF EXISTS discount_claims_insert ON public.discount_claims;
|
||||
|
||||
CREATE POLICY discount_claims_insert ON public.discount_claims
|
||||
FOR INSERT TO anon, authenticated
|
||||
WITH CHECK (true);
|
||||
|
||||
GRANT INSERT ON public.discount_claims TO authenticated;
|
||||
@@ -0,0 +1,7 @@
|
||||
CREATE TABLE IF NOT EXISTS public.app_users (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
username text UNIQUE NOT NULL,
|
||||
password_hash text NOT NULL,
|
||||
salt text NOT NULL,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
Reference in New Issue
Block a user