EXPERIMENTAL: this endpoint is experimental and is subject to change.
(rw http.ResponseWriter, r *http.Request)
| 5189 | |
| 5190 | // EXPERIMENTAL: this endpoint is experimental and is subject to change. |
| 5191 | func (api *API) putChatDebugLogging(rw http.ResponseWriter, r *http.Request) { |
| 5192 | ctx := r.Context() |
| 5193 | if !api.Authorize(r, policy.ActionUpdate, rbac.ResourceDeploymentConfig) { |
| 5194 | httpapi.Forbidden(rw) |
| 5195 | return |
| 5196 | } |
| 5197 | |
| 5198 | var req codersdk.UpdateChatDebugLoggingAllowUsersRequest |
| 5199 | if !httpapi.Read(ctx, rw, r, &req) { |
| 5200 | return |
| 5201 | } |
| 5202 | if err := api.Database.UpsertChatDebugLoggingAllowUsers(ctx, req.AllowUsers); err != nil { |
| 5203 | httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ |
| 5204 | Message: "Internal error updating chat debug logging setting.", |
| 5205 | Detail: err.Error(), |
| 5206 | }) |
| 5207 | return |
| 5208 | } |
| 5209 | rw.WriteHeader(http.StatusNoContent) |
| 5210 | } |
| 5211 | |
| 5212 | // EXPERIMENTAL: this endpoint is experimental and is subject to change. |
| 5213 | // |
nothing calls this directly
no test coverage detected