commitmentAssigneeGuard preserves the snapshot the authority decision used. Workspace owners can act regardless of assignment.
(r *http.Request, item *models.Item)
| 28 | // commitmentAssigneeGuard preserves the snapshot the authority decision used. |
| 29 | // Workspace owners can act regardless of assignment. |
| 30 | func commitmentAssigneeGuard(r *http.Request, item *models.Item) *string { |
| 31 | if workspaceRole(r) == "owner" { |
| 32 | return nil |
| 33 | } |
| 34 | assigned := "" |
| 35 | if item.AssignedUserID != nil { |
| 36 | assigned = *item.AssignedUserID |
| 37 | } |
| 38 | return &assigned |
| 39 | } |
| 40 | |
| 41 | func writeCommitmentChanged(w http.ResponseWriter) { |
| 42 | writeError2(w, http.StatusConflict, "commitment_changed", "The commitment changed; re-preview before applying", |
no test coverage detected