How to add edit restrictions to all descendent pages

Description

When an edit restriction is added to a page, only that page is affected. Normally, this is the desired behavior. However, is some cases, allowing all descendents inherit the edit restriction is desirable. Confluence doesn't have a user interface to allow this, but a single CLI command does this. The command operates on the descendent pages that currently exist - new pages would need to be manually restricted or the command re-run.

Add edit permission

confluence --action addPermissions --space experiment --title "permissions head" --permissions edit --userId automation --descendents
4 descendent pages had Edit permission added.
[Edit] permissions where added to page: 'permissions head' in space: 'experiment' for: 'automation'.

Remove edit permission

confluence --action removePermissions --space experiment --title "permissions head" --permissions edit --userId automation --descendents
4 descendent pages had permission Edit removed.
[Edit] permissions where removed from page: 'permissions head' in space: 'experiment' for: 'automation'.

Groups can also be used

Replace --userId with --group

Removing all edit permissions

Removing all edit permissions opens up the page for all space users to edit the page.