diff --git a/coderd/workspaces.go b/coderd/workspaces.go index 3dd31fc7d5e00..8015daf97bfa6 100644 --- a/coderd/workspaces.go +++ b/coderd/workspaces.go @@ -261,7 +261,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 5e111a4e04962..22b236d00bd17 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"