Skip to content

Auto-grant project-creation permission to newly registered users - #13

Merged
johardi merged 1 commit into
mainfrom
fix/gh-12-default-project-creator-role
Jul 20, 2026
Merged

Auto-grant project-creation permission to newly registered users#13
johardi merged 1 commit into
mainfrom
fix/gh-12-default-project-creator-role

Conversation

@johardi

@johardi johardi commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Self-registered users never received the ProjectCreator client 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.
  • Defines ProjectCreator on the webprotege client and includes it in the default-roles-webprotege composite, 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 idempotent entrypoint.sh patch, following the existing fix_username_mapper pattern).
  • Scope is deliberately limited to new registrations going forward — already-registered accounts are not backfilled, matching how this has been handled ad hoc until now. Also accepted as a documented residual risk: the two built-in service accounts (admin-cli, user-management) incidentally inherit the same entitlement via default-roles-webprotege, though neither currently calls WebProtege's own project-creation API.

Test plan

  • ./test-entrypoint.sh passes (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 branches
  • Verified against a real, already-installed local WebProtege stack (existing keycloak-h2-directory volume, not a fresh install): entrypoint correctly detected the pre-existing hand-added role, skipped recreating it, and added the missing composite association
  • Registered a brand-new user through the live sign-up form post-fix and confirmed their effective client roles include ProjectCreator with no manual grant

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
@johardi
johardi merged commit 9009810 into main Jul 20, 2026
2 checks passed
@johardi
johardi deleted the fix/gh-12-default-project-creator-role branch July 20, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant