-
Notifications
You must be signed in to change notification settings - Fork 5
feat(admin-roles): add builtin roles #1895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
90b0754
feat: add OIDC group to project groups
shikanime de8dacb
feat: add system roles on project creation
shikanime feb04a6
feat(hooks): add project role hooks
shikanime a065877
feat(keycloak): add project role creation hook
shikanime 1d875bd
feat(keycloak): propagate admin roles to Keycloack
shikanime 145ad80
feat(admin-roles): add builtin roles
shikanime File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
.../server/src/prisma/migrations/20260127154602_add_oidc_group_to_project_role/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "ProjectRole" ADD COLUMN "oidcGroup" TEXT NOT NULL DEFAULT ''; |
11 changes: 11 additions & 0 deletions
11
apps/server/src/prisma/migrations/20260127164002_add_type_to_roles/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "AdminRole" ADD COLUMN "type" TEXT NOT NULL DEFAULT 'custom'; | ||
|
|
||
| -- AlterTable | ||
| ALTER TABLE "ProjectRole" ADD COLUMN "type" TEXT NOT NULL DEFAULT 'custom'; | ||
|
|
||
| -- Update AdminRole system roles | ||
| UPDATE "AdminRole" SET "type" = 'system' WHERE "name" IN ('Admin', 'Admin Locaux'); | ||
|
|
||
| -- Update ProjectRole system roles | ||
| UPDATE "ProjectRole" SET "type" = 'system' WHERE "name" IN ('Administrateur', 'DevOps', 'Développeur', 'Lecture seule'); |
26 changes: 26 additions & 0 deletions
26
apps/server/src/prisma/migrations/20260204150335_add_system_roles/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| -- Update existing Admin role to be system role 'Administrateur Plateforme' | ||
| UPDATE "AdminRole" | ||
| SET | ||
| "name" = 'Administrateur Plateforme', | ||
| "type" = 'system', | ||
| "permissions" = 3, -- Assuming 3n means bit 0 and 1 (1 | 2 = 3) | ||
| "oidcGroup" = '/admin', | ||
| "position" = 0 | ||
| WHERE "id" = '76229c96-4716-45bc-99da-00498ec9018c'::uuid; | ||
|
|
||
| -- Insert 'Lecture Seule Plateforme' system role if it doesn't exist | ||
| INSERT INTO "AdminRole" ("id", "name", "permissions", "position", "oidcGroup", "type") | ||
| VALUES ( | ||
| '35848aa2-e881-4770-9844-0c5c3693e506'::uuid, | ||
| 'Lecture Seule Plateforme', | ||
| 1, -- Assuming 1n means bit 0 | ||
| 2, | ||
| '/readonly', | ||
| 'system' | ||
| ) | ||
| ON CONFLICT ("id") DO UPDATE | ||
| SET | ||
| "name" = 'Lecture Seule Plateforme', | ||
| "type" = 'system', | ||
| "permissions" = 1, | ||
| "oidcGroup" = '/readonly'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # Please do not edit this file manually | ||
| # It should be added in your version-control system (e.g., Git) | ||
| provider = "postgresql" | ||
| provider = "postgresql" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.