workflow.yaml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. framework:
  2. workflows:
  3. blog_publishing:
  4. type: 'state_machine' # or 'state_machine'
  5. audit_trail:
  6. enabled: true
  7. marking_store:
  8. type: 'method'
  9. property: 'state'
  10. supports:
  11. - App\Entity\Article
  12. initial_marking: draft
  13. places: # defining places manually is optional
  14. - draft
  15. - reviewed
  16. - rejected
  17. - published
  18. transitions:
  19. to_review:
  20. guard: is_granted('edit', subject)
  21. from: rejected
  22. to: reviewed
  23. publish:
  24. guard: is_granted('publish', subject)
  25. from: [reviewed,draft]
  26. to: published
  27. reject:
  28. guard: is_granted('ROLE_MODERATOR')
  29. from: [reviewed, published]
  30. to: rejected
  31. to_draft:
  32. guard: is_granted('edit', subject)
  33. from: published
  34. to: draft