MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / commitmentAssigneeGuard

Function commitmentAssigneeGuard

internal/server/handlers_commitments.go:32–41  ·  view source on GitHub ↗

commitmentAssigneeGuard preserves the snapshot the authority decision used. Workspace owners can act regardless of assignment.

(r *http.Request, item *models.Item)

Source from the content-addressed store, hash-verified

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

Callers 4

handleCommitmentMoveMethod · 0.85
resolveItemScheduleMethod · 0.85

Calls 1

workspaceRoleFunction · 0.85

Tested by

no test coverage detected