-- Enable RLS for Users Table
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
-- Policies for Users Table
CREATE POLICY "Authenticated users can update their own records"
ON users
FOR UPDATE
TO authenticated
USING ((select auth.uid()::text) = id);
CREATE POLICY "Authenticated users can delete their own records"
ON users
FOR DELETE
TO authenticated
USING ((select auth.uid()::text) = id);
CREATE POLICY "All users can insert new records"
ON users
FOR INSERT
TO authenticated, anon
WITH CHECK (true);
-- Enable RLS for Users Table
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
-- Policies for Users Table
CREATE POLICY "Authenticated users can update their own records"
ON users
FOR UPDATE
TO authenticated
USING ((select auth.uid()::text) = id);
CREATE POLICY "Authenticated users can delete their own records"
ON users
FOR DELETE
TO authenticated
USING ((select auth.uid()::text) = id);
CREATE POLICY "All users can insert new records"
ON users
FOR INSERT
TO authenticated, anon
WITH CHECK (true);