Skip to content

fix(web): require org membership for space creator access - #4309

Open
richiemcilroy wants to merge 2 commits into
mainfrom
fix/space-creator-membership
Open

richiemcilroy wants to merge 2 commits into
mainfrom
fix/space-creator-membership

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Space creator access was granted from spaces.createdById alone, and that column is not cleared when someone leaves an organization, so a former member kept access to spaces they had created. Creator access in SpacesPolicy now also requires current membership (or ownership) of the space's live organization, checked in the same single query that replaced the old space lookup. This covers every path built on the policy: the space page, Spaces.getSpaceOrOrg, and FoldersPolicy (folder edit and create in a space).

Other creator checks (getSpaceAccess, AgentManagement.getSpaceAccess, dashboard space lists, search, mobile spaces, move-items) already require current organization membership and are unchanged.

Proof

  • __tests__/integration/space-creator-membership-database.test.ts (real MySQL, added to the Infra Database job): a creator removed through deleteOrganizationMembership is denied the space and folder creation; a creator with no membership row and a creator in a deleted organization are denied; current creators, the organization owner, organization admins and space members keep exactly the access they had. The three denial cases fail on main and pass here; the keep cases pass on both.
  • __tests__/unit/spaces-policy-creator-membership.test.ts: policy composition for isOwner, isMember, isAdmin and the shape of the new query.
  • Existing space and video policy suites pass (102 tests), tsc --noEmit clean for apps/web, Biome clean.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Creator access now requires current membership or ownership of the space’s live organization.

  • Space creators need current access to the organization to keep their creator access.

Reviews (2) · Last reviewed commit: "test(web): drop narrating comment in spa..." · Reviewed by Greptile

Space creator access in SpacesPolicy now also requires current membership (or ownership) of the space's live organization, so removing someone from an organization revokes the access they had through spaces they created.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Nov 17, 2026 1:50am UTC

@sandchest-com

sandchest-com Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Sandchest

Sandchest reviewed 60be456: nothing exploitable found in this change.

Sandchest reviews every change for vulnerabilities an attacker could use · 6 credits · Review details

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 17, 2026 01:50 Inactive

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Capy found no issues.

Open in Capy

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cap-web — 60be456e Deployed Nov 17, 2026 by vercel[bot]
Preview – cap-status — 60be456e Deployed Nov 17, 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