Skip to content

feat(access-control): let members create organization workspaces - #10753

Open
waleedlatif1 wants to merge 1 commit into
stagingfrom
feat/member-workspace-creation
Open

waleedlatif1 wants to merge 1 commit into
stagingfrom
feat/member-workspace-creation

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • On billing-enabled deployments only org owners/admins can create organization workspaces, so members of a Team/Enterprise org who were never invited anywhere land with no workspace.
  • Enterprise orgs can now turn on Members can create workspaces under Workspace Creation in the default permission group (allowMemberWorkspaceCreation, new grant enforcement kind, off by default, so no org changes until an admin opts in).
  • Read only from the default group, which also governs every workspace no other group targets, so member-created workspaces are always governed. With it on, a member with no workspace gets one on their next visit via the existing first-load path.
  • Enforcement in lib/workspaces/policy.ts: decided in getWorkspaceCreationPolicy, re-read under the permission-group lock in lockWorkspaceCreationContext, requires Enterprise on the locked subscription row (a Team downgrade mid-request fails closed), never opens the personal fallback for a lapsed/past-due org, and disableWorkspaceCreation still blocks everyone. Mothership org chat build / benchmarks follow through canCreateOrganizationWorkspace.
  • Editor: a switch nested under Workspace Creation, editable on the default group, inert elsewhere, hidden when billing is off (members can already create there). Docs + v2 OpenAPI/CLI regenerated.

Test plan

  • lib/workspaces/member-creation.integration.ts against Postgres: 8 cases (no grant, grant, grant on non-default group, restriction overrides grant, grant withdrawn before insert, Team downgrade before insert, non-Enterprise org, past-due org). Red proofs: staging policy.ts, removing the in-transaction grant recheck, honoring the grant in the lapsed branch, and removing the Enterprise recheck each turn the matching tests red.
  • policy.test.ts, fields.test.ts, features.test.ts, group-detail.test.tsx
  • check:permission-group-enforcement, check:application-graph, check:capability-subject, check:api-validation:strict, check:test-patterns, check:comment-hygiene, docs checks

On billing-enabled deployments only organization owners and admins could
create organization workspaces, so members of a Team or Enterprise
organization who were never invited anywhere landed with no workspace.

Enterprise organizations can now turn on "Members can create workspaces"
under Workspace Creation in the default permission group
(`allowMemberWorkspaceCreation`, a new `grant` enforcement kind, off by
default). It is read only from the default group, which also governs
every workspace no other group targets, so member workspaces are always
governed. With it on, a member with no workspace gets one on their next
visit through the existing first-load path.

The grant is re-read under the permission-group lock at insert, requires
Enterprise on the locked subscription row, never opens the personal
fallback for a lapsed organization, and the Workspace Creation
restriction still blocks everyone.
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Dec 4, 2026 12:37am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 files

Confidence score: 5/5

  • In group-detail.tsx, non-default group editors see an inert switch because it is only disabled. Render the grant switch only when viewingGroup.isDefault.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/ee/access-control/components/group-detail.tsx">

<violation number="1" location="apps/sim/ee/access-control/components/group-detail.tsx:716">
P3: The switch is rendered on every billing-enabled group, merely disabled on non-default groups; expose this grant only when `viewingGroup.isDefault` so non-default group editors do not show an inert control.</violation>
</file>

Turn on auto-fix | Re-trigger cubic

* still shown so a value kept from an earlier default group stays visible. Hidden without
* billing, where every member can already create workspaces.
*/
...(billingEnabled && {

@cubic-dev-ai cubic-dev-ai Bot Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The switch is rendered on every billing-enabled group, merely disabled on non-default groups; expose this grant only when viewingGroup.isDefault so non-default group editors do not show an inert control.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/ee/access-control/components/group-detail.tsx, line 716:

<comment>The switch is rendered on every billing-enabled group, merely disabled on non-default groups; expose this grant only when `viewingGroup.isDefault` so non-default group editors do not show an inert control.</comment>

<file context>
@@ -707,6 +708,31 @@ export function GroupDetail({
+     * still shown so a value kept from an earlier default group stays visible. Hidden without
+     * billing, where every member can already create workspaces.
+     */
+    ...(billingEnabled && {
+      'disable-workspace-creation': (
+        <div className='flex items-center justify-between gap-3'>
</file context>
Suggested change
...(billingEnabled && {
...(billingEnabled && viewingGroup.isDefault && {
Fix with cubic

This branch was successfully deployed

1 active deployment
Preview — cc4f4630 Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant