Skip to content

Commit 609b0bd

Browse files
andresdjassoclaude
andcommitted
fix(landing): restore SandboxWorkspacePermissionsProvider for the capture harness
Staging removed the sandbox provider as unused when the academy pages were deleted (#5388), but the landing-preview capture route committed on this branch imports it - the branch failed to compile after rebasing. Restore the lightweight provider with its consumer documented. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent be0e428 commit 609b0bd

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

apps/sim/app/workspace/[workspaceId]/providers/workspace-permissions-provider.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,36 @@ export function useUserPermissionsContext(): WorkspaceUserPermissions & {
245245
const { userPermissions } = useWorkspacePermissionsContext()
246246
return userPermissions
247247
}
248+
249+
/**
250+
* Lightweight permissions provider for sandbox/capture contexts (the
251+
* landing-preview capture harness). Grants full edit access without any API
252+
* calls or workspace dependencies.
253+
*/
254+
export function SandboxWorkspacePermissionsProvider({ children }: { children: React.ReactNode }) {
255+
const sandboxPermissions = useMemo(
256+
(): WorkspacePermissionsContextType => ({
257+
workspacePermissions: null,
258+
permissionsLoading: false,
259+
permissionsError: null,
260+
updatePermissions: () => {},
261+
refetchPermissions: async () => {},
262+
userPermissions: {
263+
canRead: true,
264+
canEdit: true,
265+
canAdmin: false,
266+
userPermissions: 'write',
267+
isLoading: false,
268+
error: null,
269+
isOfflineMode: false,
270+
},
271+
}),
272+
[]
273+
)
274+
275+
return (
276+
<WorkspacePermissionsContext.Provider value={sandboxPermissions}>
277+
{children}
278+
</WorkspacePermissionsContext.Provider>
279+
)
280+
}

0 commit comments

Comments
 (0)