feat: share pages and cloud workspaces with people and teams
Merged
SA
1mo ago+9837+9837+0123456789012345678901234567890123456789-784-784-012345678901234567890123456789
Share pages and cloud workspaces with individual people and teams, alongside general access. Stacked on #8317; merge after it has deployed.
What changes
- Grantees: members, teams, and people outside the org. Someone outside is invited to the organization (Free plans see the existing upgrade prompt instead), and their share becomes a member share when they accept.
- Roles: pages have Can view / Can comment, per person and for general access (
pages.organization_role). Cloud workspaces have Full access only, and no public link. - General access: "Only people invited" (was "Just me") / org / anyone with the link (pages only). Going public and narrowing ask first.
- Desktop & web: one shared
ShareAccesspopover (@superset/ui/share-access) for pages and workspaces: invite field with email completion, role menus with Remove/Undo, a "Shared with me" pages tab, and share/unshare entries in the workspace timeline. View-only readers don't get the comment toggle. - Mobile: share sheets for pages and cloud workspaces (Share on a cloud workspace now opens it instead of the iOS share sheet), an Invite screen using the native search bar with a level per person, and bottom sheets for each person's access and for general access.
API (packages/trpc)
- New:
page.sharing.{get,add,remove,setRole},page.setOrganizationRole,cloudWorkspace.sharing.{get,add,remove}. Owner only; every grantee is validated against the organization. - Access goes through
pageAccess/pageReadableByandcanOpenWorkspace/visibleTo, which add direct and team shares. Comment writes, including comment image uploads, need comment access. Page tools (page.tools) count shares too, so someone a private page is shared with can use its tools. - Compatibility with released clients:
page.listscopes gainshared;page.countsgainsshared;page.accessgainscanComment/canManage; activity rows gainshareTarget.minenow also filters on the creator, which keeps its meaning now that other people's private pages can be shared with you. No existing field is removed or retyped. - Behaviour to note: anyone a workspace is shared with has full access, which includes archiving it, the same as org members on an org-visible workspace.
- Invitation shares:
afterAddMemberturns them into member shares on accept;afterCancelInvitation/afterRejectInvitationdelete them; expired ones stay hidden (listGranteesonly lists pending, unexpired invitations) until the invitation row goes and the FK cascades.afterRemoveMemberremoves a departing member's shares. - Grantees are checked against the resource's organization in
validateGrantees(notInOrganization); the database does not enforce it.
Verification
- Desktop (CDP), web (headless Chrome), and iOS (Limrun simulator), each against a seeded test org on a dev Neon branch, with database rows checked after each step. Invites went only to Resend test addresses.
- API permission checks: direct and team access, revoke on removal, NOT_FOUND for people without access, no onward sharing, outsiders refused, invite acceptance converts the share, view vs comment enforced.
- Tests: shared, trpc, ui, auth, i18n, mobile, and the touched desktop suites pass (
--isolate).check:i18npasses with all 16 locales translated,check:pluginspasses, and Biome is clean. - Typecheck: the only errors are better-auth plugin types that fail identically on
mainwith a fresh install in this sandbox.
Not covered / follow-ups
- The Free-plan upgrade prompt was not exercised.
- A rare mobile freeze was seen during simulator testing (
undefined is not a function, then React's "Should not already be working"). It could not be reproduced and had no stack trace. - "Cancel invite" removes the share but leaves the org invitation pending.
Summary by CodeRabbit
- New Features
- Share pages and cloud workspaces with people, teams, or email invitees; manage access levels, invitations, and general visibility.
- Find pages shared with you in a dedicated dashboard tab.
- View workspace sharing and access changes in the activity timeline.
- Manage sharing from mobile with dedicated access, invite, and permission screens.
- Access Controls
- Page comment controls now reflect your permission level; shared pages support view or comment access.
- Invitation and membership changes update pending shares accordingly.