enhancement
major
minor
defect
critical
major
minor
minor
#30211
React: The built-in rules for `delete-object` and similar take precedence over the configured ones (making `visible-if` ineffective)
Problem
<delete-object/> (as well as < persist-transient> and < create-transient>) has its own executability rules that are evaluated before the configured ones. If one of these rules is violated (e.g., lack of delete permissions), the command remains visibly active, even if a configured <visible-if> rule would normally hide it. For configured rules, the order in <executability> determines which rule takes precedence (a < visible-if> can be placed at the beginning). The built-in rules, however, cannot be reordered: a <visible-if> cannot be placed before them.
The same applies to the checks from a command’s <access>: They run before the configured rules, so that, for example, a command with <access><operation name="Write" object="$area" .../></access> and <visible-if expr="$structure == 'line'"/> remains disabled but visible if $area is empty.
Version: 8.0.0-alpha12, React View Layer (tl-layout-view/tl-layout-react).
Reproduction (Prime)
Archive, “Documents” tab, Links: “Delete Link” command with <visible-if expr="$readOnly != true"/> and the <delete-object/> action.
- In the Archive (no delete permission), “Delete Link” remains visible as a disabled entry.
Prime: The document and link are deleted via script. Side effect: The “Yes” button in the confirmation prompt is not red.
Expected Behavior
- Configured visible-if rules take precedence over the built-in rules.
- The red deletion confirmation prompt can also be configured for deletions via script.
Solution
- A command’s configured <executability> rules are evaluated first, followed by the checks from <access>, and finally the rule that includes an action itself (delete-object, persist-transient, create-transient). Within the configured rules, their order continues to determine which rejection takes precedence (see #30210). A configured `visible-if` rule thus hides the command even if a built-in check would reject it.
- A command in the clique="delete" group is destructive even if its actions do not explicitly indicate this (e.g., deletion via <execute-script>). A <confirm> prompt in such a command therefore displays the affirmative response in red, as with <delete-object/>.