Skip to content

feat: Enable workspace debug logging #6838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Mar 30, 2023
Prev Previous commit
Next Next commit
Enable RBAC
  • Loading branch information
mtojek committed Mar 28, 2023
commit a9a05d45e7926926c0538ed5bb66b9ec4d2b63e6
7 changes: 7 additions & 0 deletions coderd/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,13 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
}
}

if createBuild.LogLevel != "" && !api.Authorize(r, rbac.ActionUpdate, template) {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Workspace builds with a custom log level are restricted to template authors only.",
})
return
}

var workspaceBuild database.WorkspaceBuild
var provisionerJob database.ProvisionerJob
// This must happen in a transaction to ensure history can be inserted, and
Expand Down