Skip to content

Commit

Permalink
Merge pull request #110 from js-ojus/js
Browse files Browse the repository at this point in the history
Include a check to make sure event actions are performed by singleton…
  • Loading branch information
js-ojus authored Feb 1, 2019
2 parents 888b956 + 24a683c commit a4bc409
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ func (w *Workflow) ApplyEvent(otx *sql.Tx, event *DocEvent, recipients []GroupID
return 0, err
}

var gt string
tq := `SELECT group_type FROM wf_groups_master WHERE id = ?`
row := db.QueryRow(tq, event.Group)
err = row.Scan(&gt)
if err != nil {
return 0, err
}
if gt != "S" {
return 0, errors.New("group must be singleton")
}

var tx *sql.Tx
if otx == nil {
tx, err := db.Begin()
Expand Down

0 comments on commit a4bc409

Please sign in to comment.