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

Commitefec4e6

Browse files
committed
feat: add shared_with_user_id param to sql query
1 parent4d8dc22 commitefec4e6

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

‎coderd/database/modelqueries.go‎

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

‎coderd/database/queries.sql.go‎

Lines changed: 13 additions & 6 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,12 @@ WHERE
384384
(workspaces.user_acl!='{}'::jsonbORworkspaces.group_acl!='{}'::jsonb)=sqlc.narg('shared') ::boolean
385385
ELSE true
386386
END
387-
387+
-- Filter by shared_with_user_id
388+
AND CASE
389+
WHEN @shared_with_user_id :: uuid!='00000000-0000-0000-0000-000000000000'::uuid THEN
390+
workspaces.user_acl ? (@shared_with_user_id :: uuid) ::text
391+
ELSE true
392+
END
388393
-- Authorize Filter clause will be injected below in GetAuthorizedWorkspaces
389394
-- @authorize_filter
390395
), filtered_workspaces_orderAS (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp