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

Function commitmentAssigneeGuard

internal/server/handlers_commitments.go:30–39  ·  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

28// commitmentAssigneeGuard preserves the snapshot the authority decision used.
29// Workspace owners can act regardless of assignment.
30func 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
41func writeCommitmentChanged(w http.ResponseWriter) {
42 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