feat: add shared filter to workspaces query (#19807)

Adds a `shared:<boolean>` search query to the `/workspaces [get]`
endpoint


https://github.com/user-attachments/assets/ccf84bd9-c1fd-4085-825b-2e3176a2d488

Closes
[coder/internal#972](https://github.com/coder/internal/issues/972)
This commit is contained in:
Brett Kolodny
2025-09-16 12:37:39 -04:00
committed by GitHub
parent 8487216548
commit e6b04d1918
8 changed files with 282 additions and 5 deletions
+7
View File
@@ -378,6 +378,13 @@ WHERE
latest_build.has_external_agent = sqlc.narg('has_external_agent') :: boolean
ELSE true
END
-- Filter by shared status
AND CASE
WHEN sqlc.narg('shared') :: boolean IS NOT NULL THEN
(workspaces.user_acl != '{}'::jsonb OR workspaces.group_acl != '{}'::jsonb) = sqlc.narg('shared') :: boolean
ELSE true
END
-- Authorize Filter clause will be injected below in GetAuthorizedWorkspaces
-- @authorize_filter
), filtered_workspaces_order AS (