Repository navigation
feat(access-control): let members create organization workspaces - #10753
Open
waleedlatif1 wants to merge 1 commit into
Open
waleedlatif1 wants to merge 1 commit into
waleedlatif1 wants to merge 1 commit into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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 whenviewingGroup.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>
| * still shown so a value kept from an earlier default group stays visible. Hidden without | ||
| * billing, where every member can already create workspaces. | ||
| */ | ||
| ...(billingEnabled && { |
Contributor
There was a problem hiding this comment.
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 && { |
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.
Summary
allowMemberWorkspaceCreation, newgrantenforcement kind, off by default, so no org changes until an admin opts in).lib/workspaces/policy.ts: decided ingetWorkspaceCreationPolicy, re-read under the permission-group lock inlockWorkspaceCreationContext, 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, anddisableWorkspaceCreationstill blocks everyone. Mothership org chat build / benchmarks follow throughcanCreateOrganizationWorkspace.Test plan
lib/workspaces/member-creation.integration.tsagainst 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: stagingpolicy.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.tsxcheck:permission-group-enforcement,check:application-graph,check:capability-subject,check:api-validation:strict,check:test-patterns,check:comment-hygiene, docs checks