(ctx context.Context, rw http.ResponseWriter)
| 274 | } |
| 275 | |
| 276 | func (api *API) allowChatSharing(ctx context.Context, rw http.ResponseWriter) bool { |
| 277 | if !api.chatSharingDisabled() { |
| 278 | return true |
| 279 | } |
| 280 | httpapi.Write(ctx, rw, http.StatusForbidden, codersdk.Response{ |
| 281 | Message: "Chat sharing is disabled for this deployment.", |
| 282 | }) |
| 283 | return false |
| 284 | } |
| 285 | |
| 286 | func (api *API) chatSharingDisabled() bool { |
| 287 | return rbac.ChatACLDisabled() || (api.DeploymentValues != nil && bool(api.DeploymentValues.DisableChatSharing)) |
no test coverage detected