mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(knowledge): stop listing workspace knowledge bases on stale creator identity (#6454)
GET /api/knowledge without a workspaceId ORed on knowledge_base.user_id with no permission check, so a user removed from a workspace kept seeing metadata for every KB they created there. Scope the creator fallback to legacy KBs with no workspaceId, matching the workspace-filtered branch and the detail path.
This commit is contained in:
@@ -29,6 +29,8 @@ export function createMockSql() {
|
||||
toSQL: () => ({ sql: strings.join('?'), params: values }),
|
||||
/** Mirrors drizzle's `sql``…`.as(alias)` for aliased select expressions. */
|
||||
as: (alias: string) => ({ ...fragment, alias }),
|
||||
/** Mirrors drizzle's `sql``…`.mapWith(decoder)` for typed select expressions. */
|
||||
mapWith: (decoder: unknown) => ({ ...fragment, decoder }),
|
||||
}
|
||||
return fragment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user