App Presets › Open SaaS
Open SaaS (personal + join links)
The public-SaaS / multi-workspace shape: per-workspace control over how new members join. Workspace admins choose between invite-only and a shareable open link for each workspace they own. Built incrementally across Reshape 2 slices.
Current status (Reshape 2b shipped):
| Capability | Status |
|---|---|
Per-workspace join_policy (invite / open_link) |
✅ |
WorkspaceJoinLink model + atomic rotate + revoke |
✅ |
| Workspace settings UI (radio + show-once link reveal + rotate/revoke) | ✅ |
Instance allowlist (SIGNUP_PERMITTED_JOIN_STRATEGIES) |
✅ |
| Flow A — existing authenticated user joins via link | ✅ |
| Flow B — new user via link (link opens the signup gate) | ✅ |
:domain strategy (verified-email-domain auto-join) |
⏳ not built |
What you get when configured.
| Knob | Value | Mechanism |
|---|---|---|
signup.mode |
:open or :invite_only — see posture below |
config/initializers/signup.rb (SIGNUP_MODE) |
tenancy.onboarding |
:personal — each user gets a personal workspace, then creates/joins orgs |
User#onboard_workspace |
tenancy.workspace_creation |
:enabled — users can create org workspaces |
WorkspacesController#new |
permitted_join_strategies |
[:invite, :open_link] |
SIGNUP_PERMITTED_JOIN_STRATEGIES=invite,open_link |
Open SaaS is Solo-default’s tenancy (personal onboarding, workspace creation on) plus the open_link join strategy — so a workspace Owner can hand out a shareable join link instead of inviting people one by one.
How users relate
An example Acme workspace. Each person (with how they sign in) connects to the workspace by their membership (role · how they joined). Sign-in is email-first and passwordless by default — a magic link, or a password where the instance turns passwords on (AUTH_PASSWORDS=enabled) — with Google/GitHub OAuth alongside:
Signup posture — pick one
Open SaaS supports two front-door postures. They differ only in whether a stranger can create an account with no invitation and no link; both give workspace Owners/Admins identical control over their own members.
| Fully public | Controlled-growth | |
|---|---|---|
SIGNUP_MODE |
open |
invite_only |
SIGNUP_PERMITTED_JOIN_STRATEGIES |
invite,open_link |
invite,open_link |
| Who can create an account | anyone, from the sign-in page (/session/new) |
only via an invitation or a valid open-link token |
| Good for | self-serve products, communities | B2B, controlled betas, “every user vouched-for” |
Choose by whether you want an anonymous front door. open maximizes self-serve discovery. invite_only + open_link means every account traces to an invitation or a shared link — no cold signup — at the cost of no organic self-registration.
The two knobs are independent. SIGNUP_MODE controls who may create an account; SIGNUP_PERMITTED_JOIN_STRATEGIES controls which join mechanisms exist. Setting SIGNUP_MODE=open does not enable shareable links — you still need SIGNUP_PERMITTED_JOIN_STRATEGIES=invite,open_link for that. Both postures above set the strategies allowlist explicitly for exactly this reason.
SIGNUP_MODEis not how you “get an admin.” It only controls the anonymous front door. Your admin account, and the power to invite / approve / remove members, come from a workspace Owner/Admin role (manage_members) — present in either posture. Member administration is per-workspace, so a user who self-registers underopenowns and administers their own workspace. Instance-wide administration is the operations area (/operations), open only to operators — see Instance operations — and it isn’t aSIGNUP_MODEsetting either.
Verify the strategy is enabled. With SIGNUP_PERMITTED_JOIN_STRATEGIES=invite,open_link set, in bin/rails console:
SignupPolicy.permits_strategy?(:open_link) # => true
w = Workspace.create!(name: "Acme", personal: false, join_policy: "open_link")
w.open_join? # => true (open to link-joins)
If permits_strategy?(:open_link) is false, the env var isn’t set — links will be inert and the join-policy radio shows “Shareable join link” disabled.
Setup (Reshape 2a — Flow A):
- Set
SIGNUP_PERMITTED_JOIN_STRATEGIES=invite,open_link(default isinvitealone — preserves Solo-default). - Owner/Admin opens their workspace’s
/workspaces/:slug/settings/editand selects “Shareable join link” under Join policy. - The full link (form
/workspaces/:slug/joins/:token) is shown once, right after you generate or rotate it — copy it then. The token is hashed at rest, so the settings page can’t re-display it later: it shows a masked stub with Rotate / Revoke, and Rotate mints a fresh link to copy. - Share the link with anyone who has an account on this instance — clicking lands them on a confirmation page; the Join button admits them as a Member.
Key behaviors (Reshape 2a):
- Personal workspaces are hard-guarded —
Workspace#open_join?returnsfalsefor personal workspaces regardless ofjoin_policy. A personal workspace cannot be configured asopen_link(validation rejects). - Instance allowlist enforced at two layers — model validation (admins can’t set
:open_linkwhen the instance forbids it) AND runtime guard (Workspace#open_join?re-checks defense-in-depth). - Atomic rotate — clicking “Rotate” revokes the current link and creates a new one in one transaction. The previous link stops working immediately.
- Capacity respected —
Workspace#admithonorsmax_members; an over-capacity join surfaces a clean error. - Single membership-grant entry point — both invitation acceptance and link self-join go through
Workspace#admit, sharing the same lock, capacity, and (under:sharedposture) role-reconciliation logic. - Settings UI auto-hidden under
:sharedposture — single-tenant deployments don’t see the join-policy section.
Setup (Reshape 2b — Flow B): Already enabled by the same SIGNUP_PERMITTED_JOIN_STRATEGIES=invite,open_link setting from 2a. The Flow B path is automatic:
- Brand-new visitor (no account) clicks a shareable join link.
Workspaces::JoinsController#createstashes the token insession[:pending_join_token]and redirects to the sign-in page (/session/new).SignupPolicy.allows_signup?checksworkspace_join_acceptable?— the open-link token opens the gate even underSIGNUP_MODE=invite_only. The signup form renders.- Visitor signs up via magic-link (
MagicLinkCallbacksController#create).Signupable#commit_signup_atomicallyclaims the parked join token viaPendingClaims, admitting them atomically during signup — no separate email-verification step required for join-link claims. - User lands signed in and is immediately a workspace Member.
Stale conditions at claim time (link revoked, workspace policy reverted to :invite, instance allowlist no longer permits :open_link) are silently no-op’d — email verification proceeds and the user lands signed in but without the workspace membership. Capacity is the exception: a full workspace rolls a Flow B signup back, so no account is created (PendingClaims#claim! lets Workspace::AtCapacity propagate); only a claim made at email verification reports capacity as a flash without blocking sign-in.
Pre-existing users are never auto-joined. Only a brand-new account created in the signup flow auto-joins — its signup is its consent. If the person who authenticates with a parked token turns out to be an existing user (e.g. they followed the link logged out, then signed in, or linked a new verified OAuth provider), they are not silently added. Instead they see a dismissible “You followed a link to join X — Join / Dismiss” banner (PendingJoinsController) and re-consent explicitly. This closes a drive-by-join where a lured-in token would otherwise force-join a victim.
Tightening the allowlist on a live app. Removing open_link from SIGNUP_PERMITTED_JOIN_STRATEGIES (e.g. reverting to SIGNUP_PERMITTED_JOIN_STRATEGIES=invite) takes effect immediately at runtime — there is no data migration. Workspace#open_join? re-checks the allowlist on every call, so all existing shareable links stop working at once and both Flow A and Flow B silently no-op. Workspaces keep their stored join_policy: "open_link" value, but it is now inert.
That stale value has one sharp edge: join_policy_must_be_permitted_by_instance validates on every save, so a workspace still carrying open_link becomes unsaveable — editing any unrelated field (name, color, …) fails with “Join policy is not permitted by this instance” — until its policy is reset.
Reset command. Reconcile stale workspaces back to a permitted policy from the Rails console (bin/rails console). update_all is deliberate here — it bypasses the very validation that would otherwise block the fix:
# Reset every workspace still carrying the now-forbidden open_link policy.
Workspace.where(join_policy: "open_link").update_all(join_policy: "invite")
Their already-issued join links stay in the table but are inert (open_join? is false). Leave them, or revoke individually via the settings UI or link.revoke!.
When to switch presets.
- “I want to lock signup entirely; users should only join via admin invitation.” → keep
SIGNUP_PERMITTED_JOIN_STRATEGIES=inviteand the per-workspace radio defaults to invite — this is Solo-default with no further changes. - “Everyone should be in one shared workspace with no join UI at all.” → Single-tenant preset.
Next steps
- ← Compare all presets — the decision matrix and the other three shapes.
- Extending ModelRails → — add your own workspace-scoped features on top of this preset.