@@ -528,7 +528,7 @@ func createWorkspace(
528
528
// Do this upfront to save work. If this fails, the rest of the work
529
529
// would be wasted.
530
530
if ! api .Authorize (r , policy .ActionCreate ,
531
- rbac .ResourceWorkspace .InOrg (template .OrganizationID ).WithOwner (user .ID .String ())) {
531
+ rbac .ResourceWorkspace .InOrg (template .OrganizationID ).WithOwner (owner .ID .String ())) {
532
532
httpapi .ResourceNotFound (rw )
533
533
return
534
534
}
@@ -588,7 +588,7 @@ func createWorkspace(
588
588
// read other workspaces. Ideally we check the error on create and look for
589
589
// a postgres conflict error.
590
590
workspace , err := api .Database .GetWorkspaceByOwnerIDAndName (ctx , database.GetWorkspaceByOwnerIDAndNameParams {
591
- OwnerID : user .ID ,
591
+ OwnerID : owner .ID ,
592
592
Name : req .Name ,
593
593
})
594
594
if err == nil {
@@ -621,7 +621,7 @@ func createWorkspace(
621
621
ID : uuid .New (),
622
622
CreatedAt : now ,
623
623
UpdatedAt : now ,
624
- OwnerID : user .ID ,
624
+ OwnerID : owner .ID ,
625
625
OrganizationID : template .OrganizationID ,
626
626
TemplateID : template .ID ,
627
627
Name : req .Name ,
@@ -689,8 +689,8 @@ func createWorkspace(
689
689
ProvisionerJob : * provisionerJob ,
690
690
QueuePosition : 0 ,
691
691
},
692
- user .Username ,
693
- user .AvatarURL ,
692
+ owner .Username ,
693
+ owner .AvatarURL ,
694
694
[]database.WorkspaceResource {},
695
695
[]database.WorkspaceResourceMetadatum {},
696
696
[]database.WorkspaceAgent {},
@@ -712,8 +712,8 @@ func createWorkspace(
712
712
workspace ,
713
713
apiBuild ,
714
714
template ,
715
- user .Username ,
716
- user .AvatarURL ,
715
+ owner .Username ,
716
+ owner .AvatarURL ,
717
717
api .Options .AllowWorkspaceRenames ,
718
718
)
719
719
if err != nil {
0 commit comments