Repository navigation
Team leads can add any user except the core admin; allow email usernames - #142
Merged
Merged
Conversation
…ow email usernames - Team leads can now add and remove any user: the role restriction (plain users only) is gone, from add, remove and the type-ahead search. The one exclusion is the core admin account (ANGLES_ADMIN_USERNAME, default "admin"): it is never offered, a team lead cannot add or remove it, and the member list flags it with isCoreAdmin. Team leads still cannot remove themselves. - Usernames for membership accept . _ @ + - (2-254 chars) so SSO accounts whose username is an email address can be found and added. The search term is regex-escaped so . and + are matched literally. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0121r5gnmvth6hy4tPpNT8sM
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
Fixes two problems with adding team members, found after the type-ahead shipped.
q) andPOST /team/:id/membersonly accepted[A-Za-z0-9-_], so SSO accounts whose username is an email address could not be found or added. Both now accept. _ @ + -(search 3-254 chars, username 2-254). The search term is regex-escaped so.and+match literally.userrole, so local team leads and admins never appeared. That restriction is removed: a team lead can add and remove any user, whatever their role or sign-in method.ANGLES_ADMIN_USERNAME, defaultadmin, new helpergetCoreAdminUsername) is never returned by the search, a team lead cannot add or remove it, and the member list flags it withisCoreAdminso a client can show it as locked. Admins can still add it. Team leads still cannot remove themselves.Consequences to be aware of
Swagger updated.
Testing
test/team-members.tests.jsupdated and extended (45 tests): leads see and can add other leads, admins and SSO users; the core admin is never offered and a lead cannot add or remove it; email-style usernames are found and added, with.and+matched literally; theisCoreAdminflag. The suite pointsANGLES_ADMIN_USERNAMEat a test account, so it does not depend on anadminuser existing. Full suite: 680 passing.Companion PRs: AnglesHQ/angles-ui, AnglesHQ/angles-javascript-client, AnglesHQ/angleshq.github.io.
🤖 Generated with Claude Code
https://claude.ai/code/session_0121r5gnmvth6hy4tPpNT8sM
Generated by Claude Code