diff --git a/coderd/workspaces.go b/coderd/workspaces.go index 36a7762b69..0ee26342ab 100644 --- a/coderd/workspaces.go +++ b/coderd/workspaces.go @@ -263,7 +263,8 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req return } - if !api.Authorize(rw, r, rbac.ActionRead, template) { + if !api.Authorize(r, rbac.ActionRead, template) { + httpapi.ResourceNotFound(rw) return } diff --git a/coderd/workspaces_test.go b/coderd/workspaces_test.go index fce15913e6..cdab39422e 100644 --- a/coderd/workspaces_test.go +++ b/coderd/workspaces_test.go @@ -2,6 +2,7 @@ package coderd_test import ( "context" + "fmt" "net/http" "strings" "testing"