Is it possible to change the rule dynamically

From the previous example, I know how to create a custom rule, and then I want to ask if it is possible to change the rule dynamically (for example via a button). Because I want to implement such a function: when pressing button A, all elements can not be moved, the diagram is in read-only mode, when button B is pressed, the diagram is in writable mode.

Why wouldn’t it be? It’s not possible to remove a rule once you added it but you can change what it evaluates to.

That is to say, the rules are set in the programming phase and cannot be changed during the running phase, right? However, what if we encounter such a scenario: For a rule (for example, shape.create), different types of users perform different behaviors , such as advanced users can create more typse of elements.