You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(folders): generalize resource locking across workflows, files, knowledge bases, and tables
- New generic locking engine (packages/platform-authz/src/resource-lock.ts):
one config-driven RESOURCE_LOCK_LOOKUP + ResourceLockedError, mirroring the
PINNED_RESOURCE_LOOKUP/FolderCascadeConfig pattern already established for
folders/pinning. packages/platform-authz/src/workflow.ts's lock exports
become thin resourceType='workflow' wrappers over the generic engine --
WorkflowLockedError/FolderLockedError are now ResourceLockedError
subclasses, so all ~30 existing call sites keep working unchanged
- New locked column on workspaceFiles/knowledgeBase/userTableDefinitions
(mirrors workflow.locked), migration 0259_resource_level_locking.sql
- FOLDER_RESOURCE_POLICIES now enables real lock enforcement (not a no-op)
for all four resourceTypes -- folder-level lock cascade, previously
workflow-only, now applies uniformly
- assertResourceMutable/assertFolderMutable wired into the structural
mutation entry points for each type: file rename/delete/move/restore
(including bulk folder-scoped operations), knowledge base update/delete,
table rename/delete -- locked blocks all of these but never blocks reads
(download/search/query), matching the workflow precedent
- Lock/unlock UI: row-level toggle for files/knowledge bases/tables plus
folder-level lock in their context menus, reusing the existing generic
Lock/Unlock context-menu item
- Route-level 423 test coverage added for every new lock-enforcement call
site (direct lock and folder-inherited lock)
Deep content-mutation lock enforcement (table row/column edits, knowledge
base document/chunk/connector edits) is intentionally out of scope here --
a much larger surface (~35 additional routes) that assertResourceMutable is
positioned to extend into as a follow-up, not silently dropped.
0 commit comments