framework:
    workflows: 
        campagne_publishing:
            type: 'state_machine'
            marking_store:
                type: 'method'
                property: 'state'
            supports:
                - App\Entity\Campagne
            initial_marking: prepending
            places:
                - prepending
                - pending
                - draft
                - published
                - rejected
                - expired
                - archived
            transitions:
                to_pending:
                    guard: "is_granted('ROLE_USER')"
                    from: prepending
                    to: pending
                to_draft:
                    guard: "is_granted('ROLE_USER')"
                    from: [prepending, pending, published]
                    to: draft
                to_reject:
                    guard: "is_granted('ROLE_ADMIN')"
                    from: pending
                    to: rejected
                to_publish:
                    guard: "is_granted('ROLE_USER')"
                    from: draft
                    to: published
                to_expired:
                    # guard: "is_granted('ROLE_USER')"
                    from: [published, draft, rejected]
                    to: expired
                to_archived:
                    # guard: "is_granted('ROLE_USER')"
                    from: [prepending, pending, draft, published, rejected, expired, archived]
                    to: archived

