You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a state machine to manage the different states of a product, eg: product-inserted, product-confirmed, price-inserted, price-confirmed, etc.
Different users can change the state of the product, depending on their roles, eg: logistics can insert product, marketing can confirm price, etc.
I was thinking about checking the role in a generic onBeforeTransition event and declaring the allowed roles directly in the transitions array, eg:
Unfortunately, the role attribute is not passed to the lifecycle events.
What do you think about passing the whole transition object to the lifecycle events instead of just name, from and to?
In this way that would be a breaking change, but it could also be implemented in different ways:
add the transition object without removing name, from and to
add only the custom attributes
I guess that custom attributes could be useful in many situations.
What do you think?
The text was updated successfully, but these errors were encountered:
I have a state machine to manage the different states of a product, eg: product-inserted, product-confirmed, price-inserted, price-confirmed, etc.
Different users can change the state of the product, depending on their roles, eg: logistics can insert product, marketing can confirm price, etc.
I was thinking about checking the role in a generic
onBeforeTransition
event and declaring the allowed roles directly in the transitions array, eg:Unfortunately, the
role
attribute is not passed to the lifecycle events.What do you think about passing the whole transition object to the lifecycle events instead of just name, from and to?
In this way that would be a breaking change, but it could also be implemented in different ways:
I guess that custom attributes could be useful in many situations.
What do you think?
The text was updated successfully, but these errors were encountered: