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

Commit8377535

Browse files
committed
feat: add delete workspace ACL query
1 parent8d5c566 commit8377535

File tree

6 files changed

+58
-0
lines changed

6 files changed

+58
-0
lines changed

‎coderd/database/dbauthz/dbauthz.go‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,18 @@ func (q *querier) DeleteWebpushSubscriptions(ctx context.Context, ids []uuid.UUI
17331733
returnq.db.DeleteWebpushSubscriptions(ctx,ids)
17341734
}
17351735

1736+
func (q*querier)DeleteWorkspaceACLByID(ctx context.Context,id uuid.UUID)error {
1737+
fetch:=func(ctx context.Context,id uuid.UUID) (database.WorkspaceTable,error) {
1738+
w,err:=q.db.GetWorkspaceByID(ctx,id)
1739+
iferr!=nil {
1740+
return database.WorkspaceTable{},err
1741+
}
1742+
returnw.WorkspaceTable(),nil
1743+
}
1744+
1745+
returnfetchAndExec(q.log,q.auth,policy.ActionUpdate,fetch,q.db.DeleteWorkspaceACLByID)(ctx,id)
1746+
}
1747+
17361748
func (q*querier)DeleteWorkspaceAgentPortShare(ctx context.Context,arg database.DeleteWorkspaceAgentPortShareParams)error {
17371749
w,err:=q.db.GetWorkspaceByID(ctx,arg.WorkspaceID)
17381750
iferr!=nil {

‎coderd/database/dbmetrics/querymetrics.go‎

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

‎coderd/database/dbmock/dbmock.go‎

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

‎coderd/database/querier.go‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries.sql.go‎

Lines changed: 15 additions & 0 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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,15 @@ SET
924924
WHERE
925925
id= @id;
926926

927+
-- name: DeleteWorkspaceACLByID :exec
928+
UPDATE
929+
workspaces
930+
SET
931+
group_acl='{}'::json,
932+
user_acl='{}'::json
933+
WHERE
934+
id= @id;
935+
927936
-- name: GetRegularWorkspaceCreateMetrics :many
928937
-- Count regular workspaces: only those whose first successful 'start' build
929938
-- was not initiated by the prebuild system user.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp