From 0301d4bfb195e1599dc88419ac639c42726fa186 Mon Sep 17 00:00:00 2001 From: Maxime Golfier <25312957+maxgfr@users.noreply.github.com> Date: Mon, 28 Nov 2022 10:42:16 +0100 Subject: [PATCH] fix(roles): ajout du role admin pour dev (#848) --- .kube-workflow/sql/post-restore.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.kube-workflow/sql/post-restore.sql b/.kube-workflow/sql/post-restore.sql index e9e46c856..dc00100b8 100644 --- a/.kube-workflow/sql/post-restore.sql +++ b/.kube-workflow/sql/post-restore.sql @@ -6,6 +6,18 @@ TRUNCATE TABLE "auth"."users" CASCADE; ALTER TABLE auth.users DISABLE TRIGGER USER; +WITH admin_row AS ( +INSERT INTO auth.users (email, PASSWORD, name, default_role, active, id) + VALUES ('codedutravailnumerique@travail.gouv.fr', '$argon2i$v=19$m=4096,t=3,p=1$n9eoWSv+5sCgc7SjB5hLig$iBQ7NzrHHLkJSku/dCetNs+n/JI1CMdkWaoZsUekLU8', 'Administrateur', 'super', TRUE, 'd8b11bd2-dd16-4632-b5de-0e7021faadeb') + RETURNING + id, default_role) + INSERT INTO auth.user_roles (ROLE, user_id) + SELECT + default_role, + id + FROM + admin_row; + WITH admin_row AS ( INSERT INTO auth.users (email, PASSWORD, name, default_role, active, id) VALUES ('utilisateur@travail.gouv.fr', '$argon2i$v=19$m=4096,t=3,p=1$PqKPf9cxunVLLtEcINHhWQ$CwHKhk71fc8LGp6BWbcFPzQ2ftOiHa7vUkp1eAqVHSM', 'Utilisateur', 'user', TRUE, '3d6dddc4-e117-4772-9288-cd8a608693e4')