mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-22 10:33:27 +00:00
117221c73d
Update workspace resolution to support both slugs and UUIDs, with
auth-scoped slug resolution for non-admin users (TASK-412).
Store:
- New GetWorkspacesBySlugForUser(slug, userID) method that finds
workspaces matching a slug where the user is owner or member
Server:
- New resolveWorkspace() method: UUID → direct lookup, slug → auth-scoped
for regular users, global for admins/unauthenticated
- RequireWorkspaceAccess middleware uses resolveWorkspace() and stores
resolved workspace ID in context (ctxResolvedWorkspaceID)
- getWorkspaceID() reads from context (fast path) or resolves directly
(fallback), eliminating redundant database lookups
API URL pattern unchanged — /api/v1/workspaces/{ws}/... where {ws}
now accepts both slug and UUID. CLI and frontend unaffected.