Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Update existing Admin role to be system role 'Administrateur Plateforme'
UPDATE "AdminRole"
SET
SET
"name" = 'Administrateur Plateforme',
"type" = 'system',
"permissions" = 3, -- Assuming 3n means bit 0 and 1 (1 | 2 = 3)
Expand Down
28 changes: 28 additions & 0 deletions apps/server/src/prisma/migrations/20260206105522_dso/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- Update existing Admin role to be system role 'Root Administrateur Plateforme'
UPDATE "AdminRole"
SET
"name" = 'Root Administrateur Plateforme'
WHERE "id" = '76229c96-4716-45bc-99da-00498ec9018c'::uuid;

-- Insert 'Administrateur Plateforme' system role if it doesn't exist
INSERT INTO "AdminRole" ("id", "name", "permissions", "position", "oidcGroup", "type")
VALUES (
'6bebe7b2-0f0a-456e-ab7f-b3d7640a7cbf'::uuid,
'Administrateur Plateforme',
3, -- Assuming 3n means bit 0 and 1 (1 | 2 = 3)
0,
'/console/admin',
'system'
)
ON CONFLICT ("id") DO UPDATE
SET
"name" = 'Administrateur Plateforme',
"type" = 'system',
"permissions" = 3,
"oidcGroup" = '/console/admin';

-- Update 'Lecture Seule Plateforme' system role
UPDATE "AdminRole"
SET
"oidcGroup" = '/console/readonly'
WHERE "id" = '35848aa2-e881-4770-9844-0c5c3693e506'::uuid;
10 changes: 9 additions & 1 deletion packages/test-utils/src/imports/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export const data = {
permissions: '3n',
position: 0,
oidcGroup: '/admin',
name: 'Root Administrateur Plateforme',
type: 'system',
},
{
id: '6bebe7b2-0f0a-456e-ab7f-b3d7640a7cbf',
permissions: '3n',
position: 0,
oidcGroup: '/console/admin',
name: 'Administrateur Plateforme',
type: 'system',
},
Expand All @@ -39,7 +47,7 @@ export const data = {
id: '35848aa2-e881-4770-9844-0c5c3693e506',
permissions: '1n',
position: 2,
oidcGroup: '/readonly',
oidcGroup: '/console/readonly',
name: 'Lecture Seule Plateforme',
type: 'system',
},
Expand Down
Loading