Auto-grant project-creation permission to newly registered users - #13
Merged
Conversation
The ProjectCreator client role has only ever been added by hand to running instances and was missing from the checked-in realm export, so self-registered users never received it and never saw the "Create New Project" button. Define ProjectCreator on the webprotege client and include it in the default-roles-webprotege composite, so every new user gets it automatically via Keycloak's own default-role mechanism. Patch already-imported realms in place via a new idempotent entrypoint.sh function, following the same pattern as fix_username_mapper. Fixes #12
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ProjectCreatorclient role, so they never saw the "Create New Project" button — the role has only ever existed as a hand-added, ad hoc grant on running instances, and was missing from the checked-in realm export entirely.ProjectCreatoron thewebprotegeclient and includes it in thedefault-roles-webprotegecomposite, so every new user (self-registered or admin-created) gets it automatically via Keycloak's own default-role mechanism, both on fresh installs and on already-running realms (via a new idempotententrypoint.shpatch, following the existingfix_username_mapperpattern).admin-cli,user-management) incidentally inherit the same entitlement viadefault-roles-webprotege, though neither currently calls WebProtege's own project-creation API.Test plan
./test-entrypoint.shpasses (30/30 assertions), including a new phase that deliberately deletes the role/association and restarts to exercise the actual create/associate code path, not just the idempotent skip brancheskeycloak-h2-directoryvolume, not a fresh install): entrypoint correctly detected the pre-existing hand-added role, skipped recreating it, and added the missing composite associationProjectCreatorwith no manual grant