Repository navigation
feat(workspaces): invite people; they join when they accept (D4) - #494
Merged
Merged
Conversation
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 29fcafef-fee5-4d20-b552-d494b43b3e52) |
Contributor
Test IDsAdded (14)
|
This was referenced Oct 10, 2026
huyplb
force-pushed
the
feat/workspaces-shared
branch
from
October 10, 2026 04:27
e86e756 to
e133993
Compare
… accept D4 of the workspaces plan. - Invite by email with a role from Workspace settings; the invitee sees it under Invitations in the profile menu and accepts or declines. Invites ask, they never add. 14-day expiry; a new invite replaces a pending one; owners revoke. - Everyone may invite into their own workspace, whatever its role there; elsewhere it needs workspace.members. - An email with no account: only admins may invite it (it makes a viewer account), unless the admin turns on "Workspace owners can invite new people". Only an admin ever gets that account's one-time code back; for anyone else it is emailed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
huyplb
force-pushed
the
feat/workspace-invites
branch
from
October 10, 2026 04:32
8497bc3 to
cd337da
Compare
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: ceb8d7f1-a1cc-4248-a99c-c9508bc05e18) |
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.
D4 of the workspaces plan. Stacked on #493 (D3) → #492 (D5) → #491 (D1).
What changes
workspace.members(owner by default).ceo@company.com, redeem the code and hold an account under that address./api/workspaces/invites[/:id/accept|decline],/api/workspaces/:id/invites[/:inviteId](contract table 127 → 133).Tests
workspace-invites.service.test.ts(11): ask-not-add + role on accept, decline, only for the invitee, expiry, replace, already a member,workspace.membersneeded, own-workspace rule, new-account gate + setting, input checks. A/B: invite-adds, anyone-makes-accounts and no-own-workspace-rule each fail.workspaces.routes.test.ts: the code goes back to an admin and never to anyone else (A/B checked).workspaces.test.ts(6/6 against the dev server): an admin invites a throwaway account through settings; that account, in its own browser, is refused before accepting, accepts from its menu, lands in the workspace as editor and sees the shared connection.Review
Fixed: the new-account code reaching non-admin inviters. Left: revoking an invite does not remove the account it created; invites to existing accounts are not emailed (shown in the menu only).
🤖 Generated with Claude Code
Note
Medium Risk
Touches membership, user provisioning, and admin policy with deliberate code-redaction rules; mistakes could leak invite codes or grant workspace access incorrectly.
Overview
Adds workspace invitations: invite by email with a role from workspace settings, pending invites in the profile menu (accept joins with that role and switches workspace; decline removes it), and owner-side list/revoke. Membership is opt-in only (14-day expiry; a new invite replaces a pending one).
Extends who can invite: shared workspaces need
workspace.members(owners); personal workspaces let the owner manage invites/member roles regardless of workspace role. New emails without accounts can only be invited by admins unless Workspace owners can invite new people is enabled in admin policy; that path creates a viewer account. One-time account codes are returned only to admins on the invite API; non-admins get delivery status only so they cannot claim accounts under arbitrary addresses.Ships six new workspace invite API routes, frontend API/UI wiring, admin policy toggle, generated test IDs, and server/component/e2e tests.
Reviewed by Cursor Bugbot for commit cd337da. Bugbot is set up for automated code reviews on this repo. Configure here.