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

Commit2c387ce

Browse files
committed
refactor: simplify workspace type assertion
1 parent1f0e33a commit2c387ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎coderd/workspacebuilds.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,11 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
397397
returntrue
398398
}
399399
// Special handling for prebuilt workspace deletion
400-
ifobject.RBACObject().Type==rbac.ResourceWorkspace.Type&&action==policy.ActionDelete {
401-
ifworkspaceObj,ok:=object.(database.Workspace);ok&&workspaceObj.IsPrebuild() {
400+
ifaction==policy.ActionDelete {
401+
ifworkspaceObj,ok:=object.(interface {
402+
IsPrebuild()bool
403+
AsPrebuild() rbac.Object
404+
});ok&&workspaceObj.IsPrebuild() {
402405
returnapi.Authorize(r,action,workspaceObj.AsPrebuild())
403406
}
404407
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp