mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user