feat(THU-603): user-private scope for workspace resources#998
Merged
raivieiraadriano92 merged 14 commits intoJun 21, 2026
Conversation
Semgrep Security ScanNo security issues found. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 45dff70. Configure here.
PR Metrics
Updated Thu, 18 Jun 2026 17:01:57 GMT · run #1944 |
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
THU-603 — Adds a per-row
scope = 'workspace' | 'user'axis to workspace resources (skills, models, MCP servers, agents, modes, prompts, triggers, model_profiles, model_profiles), gated by a deployment-levelallowUserScopedResourcesflag.'user'rows are private to their author within the workspace;'workspace'rows behave as today.Along the way also:
window.location.reloadsetup,useConfigStorestate leaking between suites).Commits
```
chore(THU-603): add scope column to workspace resource schemas
feat(THU-603): split sync rules by resource scope
feat(THU-603): scope-aware upload handler + config flag
feat(THU-603): thread scope through FE config and DAL
feat(THU-603): add scope picker primitive and gate hook
feat(THU-603): expose scope picker in resource UIs
feat(THU-603): accept user scope in workspace upload handler
fix(THU-603): skip default tasks when seeding new workspaces
fix(THU-603): honor composite PK in upload-handler row lookup
fix: stabilize logout-modal and skills-view flaky tests
refactor: split settings sidebar into Account / Extensions / Workspace
feat: open Workspace > General to members; read-only for non-admins
fix: reset useConfigStore between test suites to prevent leak
```
Test plan
Note
Medium Risk
Changes authorization and sync visibility across core workspace resources; mistakes could leak private rows or block legitimate multi-user default-data sync, though the upload-handler and bucket split are heavily tested.
Overview
Introduces per-row visibility (
scope:workspacevsuser) on eight synced workspace resource types (skills, models, agents, MCP servers, modes, prompts, triggers, model profiles), so authors can keep resources private within a shared workspace while shared rows behave as before.Data & sync: A migration adds
scope(defaultworkspace) on those tables. PowerSync splits buckets:workspace_dataonly syncsscope = 'workspace'rows; a newuser_scope_resourcesbucket syncsscope = 'user'rows to the row owner only.Server: Upload handlers are scope-aware—
scope = 'user'rows enforce owner-only PATCH/DELETE/upsert, with deployment flagallowUserScopedResources(envALLOW_USER_SCOPED_RESOURCES, default on) blocking new user-scoped creates when off.fetchRowScopeis fixed to disambiguate composite-PK rows when the same default-data id exists in multiple personal workspaces. Shared workspace creation no longer seeds default onboarding tasks.Client:
ScopePickeranduseScopePickerEnabledwire into resource UIs (e.g. custom agents); DAL create paths persistscope.GET /configexposesallowUserScopedResources. Workspace → General is open to all members with read-only fields for non-admins; the settings sidebar is reorganized into Account / Extensions / Workspace.Tests: Broad coverage for scope upload rules, composite-id collisions, config flag, and minor test stability fixes.
Reviewed by Cursor Bugbot for commit 2d4ff9d. Bugbot is set up for automated code reviews on this repo. Configure here.