Change of role depending on the status

all hi
i need change of role depending on the “status”.


child component save data in db
main component save data in db

i have a nested structure. When the status is “created”, a simple user should be able to view the card and its nested structure without the ability to edit it.

when there is a different “status”, that is, the ability to edit all structure with children.

I need to write a role model for each nested form?
or can I somehow assign a different role to the user?

Try to use a Predicate Policy of a row-level role.
You need to define a predicate for your Child entity CREATE , UPDATE , DELETE actions, which will enable the action only if the entity is in the required state.