50e25e3ee8
Rename subdirectories for a cleaner single-repo layout: - website-monitoring-backend/ → backend/ - website-monitoring-frontend/ → frontend/ - website-monitoring-devops/ → devops/ Update all references in package.json scripts, CI workflows, docker-compose, pre-commit hooks, and documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
25 lines
1.2 KiB
SQL
25 lines
1.2 KiB
SQL
-- Final fix for user RLS policies
|
|
-- Drop the conflicting policies and create the correct ones
|
|
|
|
-- Drop existing conflicting policies
|
|
DROP POLICY IF EXISTS "Allow user insert for anon" ON "public"."users";
|
|
DROP POLICY IF EXISTS "Allow user insert for authenticated" ON "public"."users";
|
|
DROP POLICY IF EXISTS "Allow user insert for authenticator" ON "public"."users";
|
|
DROP POLICY IF EXISTS "Allow user insert for dashboard_user" ON "public"."users";
|
|
|
|
-- Create the correct policies
|
|
DROP POLICY IF EXISTS "Allow user profile creation during registration" ON "public"."users";
|
|
CREATE POLICY "Allow user profile creation during registration" ON "public"."users"
|
|
FOR INSERT TO "anon" WITH CHECK (true);
|
|
|
|
DROP POLICY IF EXISTS "Allow authenticated user profile creation" ON "public"."users";
|
|
CREATE POLICY "Allow authenticated user profile creation" ON "public"."users"
|
|
FOR INSERT TO "authenticated" WITH CHECK (auth.uid() = id);
|
|
|
|
DROP POLICY IF EXISTS "Allow user profile creation for service role" ON "public"."users";
|
|
CREATE POLICY "Allow user profile creation for service role" ON "public"."users"
|
|
FOR INSERT TO "service_role" WITH CHECK (true);
|
|
|
|
-- Refresh schema cache
|
|
NOTIFY pgrst, 'reload schema';
|