Repository navigation
feat(auth): add CLI-designated IT accounts - #56
Merged
Merged
Conversation
Add pnpm user:set-role to promote or demote existing accounts between USER and TECHNICIAN, extract a shared requireTechnician guard for IT-only routes, and label IT accounts in the account menu. Records the decision in ADR-006 with a matching spec and plan. Closes #55
gabemoreno
approved these changes
Oct 15, 2026
Ashraful-10
approved these changes
Oct 19, 2026
gabemoreno
approved these changes
Oct 21, 2026
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
Lets operators designate accounts as IT accounts (stored role
TECHNICIAN) that are distinct from regular user accounts, and adds a single server-side guard that future IT-only abilities can reuse. No new IT abilities are added yet.Related issue
Closes #55
What changed
pnpm user:set-roleinteractively promotes an existing account toTECHNICIANor demotes it toUSER, backed by a newAuthRepository.setUserRole. Role parsing is shared withpnpm user:create.requireTechnicianguard (apps/api/src/auth/require-technician.ts) resolves the role from the server-side session on every request; the assignment route now uses it with unchanged401/403responses. Role changes apply on the next request without revoking sessions.Validation
403route test,parseUserRoleunit tests, badge component tests.git diff --checkin the pinned toolchain.user:set-roleagainst a local database (promote, demote, invalid role, unknown user), and checked the badge in a browser for IT and regular accounts at desktop and 375px widths.Screenshots or recordings
The IT badge appears next to "Signed in" in the header account button for IT accounts at desktop and mobile widths; regular accounts are unchanged.
Review notes
TECHNICIAN; "IT" is the product label. Renaming the enum was rejected to avoid a migration and an API contract change (see ADR-006).