@@ -428,7 +428,7 @@ func (api *api) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
428
428
}
429
429
430
430
if workspace .OrganizationID != organization .ID {
431
- httpapi .Write (rw , http .StatusUnauthorized , httpapi.Response {
431
+ httpapi .Write (rw , http .StatusForbidden , httpapi.Response {
432
432
Message : fmt .Sprintf ("workspace is not owned by organization %q" , organization .Name ),
433
433
})
434
434
return
@@ -493,7 +493,7 @@ func (api *api) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
493
493
}
494
494
495
495
if organization .ID != template .OrganizationID {
496
- httpapi .Write (rw , http .StatusUnauthorized , httpapi.Response {
496
+ httpapi .Write (rw , http .StatusForbidden , httpapi.Response {
497
497
Message : fmt .Sprintf ("template is not in organization %q" , organization .Name ),
498
498
})
499
499
return
@@ -503,7 +503,7 @@ func (api *api) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
503
503
UserID : apiKey .UserID ,
504
504
})
505
505
if errors .Is (err , sql .ErrNoRows ) {
506
- httpapi .Write (rw , http .StatusUnauthorized , httpapi.Response {
506
+ httpapi .Write (rw , http .StatusForbidden , httpapi.Response {
507
507
Message : "you aren't allowed to access templates in that organization" ,
508
508
})
509
509
return
0 commit comments