Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b0972f

Browse files
committed
feat: update workspace query to accept shared arg
1 parent854f3c0 commit8b0972f

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

‎coderd/database/modelqueries.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ func (q *sqlQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg GetWorkspa
275275
arg.UsingActive,
276276
arg.HasAITask,
277277
arg.HasExternalAgent,
278+
arg.Shared,
278279
arg.RequesterID,
279280
arg.Offset,
280281
arg.Limit,

‎coderd/database/queries.sql.go‎

Lines changed: 14 additions & 5 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/workspaces.sql‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ WHERE
378378
latest_build.has_external_agent=sqlc.narg('has_external_agent') ::boolean
379379
ELSE true
380380
END
381+
-- Filter by shared status
382+
AND CASE
383+
WHENsqlc.narg('shared') ::booleanIS NOT NULL THEN
384+
(workspaces.user_acl!='{}'::jsonbORworkspaces.group_acl!='{}'::jsonb)=sqlc.narg('shared') ::boolean
385+
ELSE true
386+
END
387+
381388
-- Authorize Filter clause will be injected below in GetAuthorizedWorkspaces
382389
-- @authorize_filter
383390
), filtered_workspaces_orderAS (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp