Skip to content

docs: add ADR 004 — user registration, approval, and account state#61

Open
martinydeAI wants to merge 2 commits into
developfrom
feature/issue-60-adr-user-approval
Open

docs: add ADR 004 — user registration, approval, and account state#61
martinydeAI wants to merge 2 commits into
developfrom
feature/issue-60-adr-user-approval

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Summary

Adds ADR 004 recording the architecture for user registration,
approval, and account-state lifecycle decided on #60.

The choice is modelled as a status enum (pending | approved | blocked) on the User entity, deliberately kept orthogonal from
roles. Self-signup is gated by an env-backed e-mail domain
allow-list, login is gated by a Symfony UserCheckerInterface, and
approval is performed by users with domainManager = true.

Changes

Note on #45

The active boolean planned in
#45 is superseded by
the status enum. The Implication for #45 section of the ADR spells
this out so the User-entity PR doesn't ship active only to need a
follow-up migration removing it.

Implementation

Filed as separate issues so this PR stays scoped to the decision:

  • Anonymous self-signup with email-domain allow-list
  • UserCheckerInterface to gate login for non-approved users
  • Approval queue UI for domainManager users

(Issue numbers will appear in this body once filed.)

Test plan

  • task coding-standards-markdown-check → clean.
  • Reviewer confirms the enum-over-boolean reasoning matches what
    we discussed and that the env-backed domain list is the right
    starting point.

Closes #60

🤖 Generated with Claude Code

Records the decision to model identity state with a status enum (pending | approved | blocked) on the User entity rather than gating via roles. Roles are kept orthogonal — they answer what a signed-in user can do, not whether they may sign in. The supporting architecture covers an env-backed email-domain allow-list for self-signup, a Symfony UserCheckerInterface that rejects login for non-approved users, and an approval queue restricted to users with domainManager=true.

Notes that #45's active boolean is superseded by the enum and should be updated when implemented.

Status: Draft. Index updated. CHANGELOG entry under [Unreleased] / Added. Closes #60.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Folds the domainManager: bool field originally proposed in #45 into the existing roles column as ROLE_DOMAIN_MANAGER. Promote / demote is toggling the role; scope (which domain a manager can act on) is derived from the manager's own email domain via a small voter. Site admin (ROLE_ADMIN) sits above it via role_hierarchy and short-circuits the domain-match check.

The 'Implication for #45' note is updated: the entity ships with only 'name' on top of the auth fields from #2 — both active and domainManager are superseded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Decide on user registration, approval, and account-state model

1 participant