Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,196 of 9,196 pages
About the help in other languages
All help pages

Content removal: permission and count checks

Read this page if you upgrade an installation to 6.0.15, if you give roles a limited content/remove policy, if you override design:node/removeobject.tpl, or if you call eZContentObjectTreeNode::removeSubtrees() from…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/bc/6.0/content-removal-checks.md

On this page

Content removal: permission and count checks

Read this page if you upgrade an installation to 6.0.15, if you give roles a limited content/remove policy, if you override design:node/removeobject.tpl, or if you call eZContentObjectTreeNode::removeSubtrees() from your own code.

What changed

  • A limited content/remove policy is enforced on the confirmed removal, not only on the confirmation page. Before, the check ran only when the removal information was collected for display. A confirmed removal of an entry whose subtree the policy does not fully cover could still go through. Now the removal view asks the removal information first and shows the confirmation page again instead of removing; removeSubtrees() skips such an entry and writes one warning naming its node ID. It still returns true.
  • The standard removal page states the refusal. When the user may not remove everything, it shows "Insufficient permissions" and disables the Confirm button.
  • Child counts include what the user cannot read. The counts on the confirmation (child_count, total_child_count and the MaxNodesRemoveSubtree check) come from one query without permission, visibility or language filter. Removing the location list also asks for confirmation when any node is below, readable or not.
  • The "Move to trash" checkbox disappears when nothing would go to the trash. The figure behind it (subtreeSoleNodeCount()) used to count over the whole tree, so the checkbox was shown for a removal of secondary locations only. It now counts the selected subtree. An object whose every location is selected counts as going to the trash.
  • A subtree removal also removes objects that are not translated into the siteaccess languages, including in a siteaccess with ShowUntranslatedObjects disabled. Before, such objects were refused or left behind without a node.
  • A stale node ID in the selection no longer resets the reverse-relation count of the other entries to 0.

Who is affected

  • Roles with a content/remove policy limited by class, section, subtree or owner. Removals that were accepted by mistake are now refused.
  • Templates and extensions that read the removal information: child_count and total_child_count can be higher than before, and move_to_trash is now false where it used to be true.
  • Overrides of design:node/removeobject.tpl. The default design passes disabled to the Confirm button when remove_info.can_remove_all is false; an override that ignores this still cannot remove, but shows no reason.
  • Code that calls removeSubtrees() and expected a true return to mean "everything was removed".

What to check when you upgrade

  1. Sign in as a user with a limited remove policy and try to remove a subtree the policy only partly covers. The page must state the refusal and the Confirm button must be disabled.
  2. Check the removal confirmation of a tree with items the user cannot read: the counts must include them.
  3. Remove a secondary location only: the "Move to trash" checkbox must be absent.
  4. Compare your MaxNodesRemoveSubtree setting with the new counts; it may now trigger earlier.
  5. Review overrides of node/removeobject.tpl against the standard template.
  6. Clear the template and template-override caches.

Code

  • New: eZContentObjectTreeNode::subtreeTotalNodeCount() returns the number of nodes below the node as an int, with no permission, visibility or language filter.
  • Changed: subtreeSoleNodeCount() reads path and depth from the node itself, runs one query and returns an int.
  • Changed: reverseRelatedCount() skips node IDs that no longer exist and returns 0 when none is left.
  • Changed: removeSubtrees() as described above; the information array keeps its keys, real_child_count keeps its meaning.
  • Changed: kernel/private/classes/views/content/removeobject.php, action.php and design/standard/templates/node/removeobject.tpl.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x