We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd35758 commit da3bc56Copy full SHA for da3bc56
1 file changed
apps/sim/app/api/organizations/[id]/permission-groups/[groupId]/route.ts
@@ -128,6 +128,15 @@ export const PUT = withRouteHandler(
128
? false
129
: group.appliesToAllWorkspaces
130
131
+ const effectiveIsDefault =
132
+ updates.isDefault !== undefined ? updates.isDefault : group.isDefault
133
+ if (effectiveIsDefault && !resolvedAppliesToAll) {
134
+ return NextResponse.json(
135
+ { error: 'The default group must apply to all workspaces' },
136
+ { status: 400 }
137
+ )
138
+ }
139
+
140
// Resolve and validate explicitly-provided workspaceIds before the
141
// transaction. When the request omits them for a specific-scope group
142
// ("keep current"), they're read under the lock instead (see below) so the
0 commit comments