Enhancement
Critical
Major
Detail
Detail
Major
#25921
State-dependent executability of commands
Each tl:CommandHandler has the possibility to specify a rule for its executability via a tl:ExecutabilityRule. This rule can decide per target model, on which the command is to be executed, whether the command is executable or not.
However, if you want to disable a large number of commands based on the state of an object (e.g. all write commands), then this is difficult to do via the tl:ExecutabilityRule because the configuration of all the commands in question would have to be modified in order to insert another tl:ExecutabilityRule.
In such a case, it would be better to include a central executability rule that is not configured specifically for one command, but is used generically for all command executions and can restrict executability based on the state of the target model and based on the properties of the command to be executed.
Application
Executability can be overridden globally by a configuration of tl:CommandApprovalService.
Migration
- Translate a possibly existing file webapp/WEB-INF/xml/state/ViewStateConfiguration.xml into corresponding rules of the tl:CommandApprovalService.
See also
- com.top_logic.tool.boundsec.BoundHelper.allowInState(TLContext, BoundChecker, BoundCommand, BoundObject)
- com.top_logic.layout.state.ViewStateManager - Not in-app configurable, since a specific derivation hierarchy is assumed for model elements: com.top_logic.tool.state.StatefullElement.
Test
- /com.top_logic.demo/src/test/com/top_logic/demo/scripted/layout/executability/TestCommandApprovalService.script.xml