Repository navigation
fix(web): require org membership for space creator access - #4309
Open
richiemcilroy wants to merge 2 commits into
Open
richiemcilroy wants to merge 2 commits into
richiemcilroy wants to merge 2 commits into
Conversation
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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Sandchest reviewed Sandchest reviews every change for vulnerabilities an attacker could use · 6 credits · Review details |
Member
Author
|
hey @greptileai, please re-review the PR |
This branch was successfully deployed
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.

Space creator access was granted from
spaces.createdByIdalone, and that column is not cleared when someone leaves an organization, so a former member kept access to spaces they had created. Creator access inSpacesPolicynow 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, andFoldersPolicy(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 throughdeleteOrganizationMembershipis 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 forisOwner,isMember,isAdminand the shape of the new query.tsc --noEmitclean forapps/web, Biome clean.

Confidence Score: 5/5
The PR appears safe to merge.Summary
Creator access now requires current membership or ownership of the space’s live organization.
Reviews (2) · Last reviewed commit: "test(web): drop narrating comment in spa..." · Reviewed by Greptile