In native Confluence without ScriptRunner, editing restrictions that are added to a parent page are not inherited to the child pages. Only view restrictions are supported because they are inherited. This means that pages need to be restricted individually for editing.

With ScriptRunner for Confluence, the Add/Remove Restrictions to Parent & Child Pages built-in script, you can add the editing restrictions to all of the child pages. It is quick and easy to select multiple page trees or individual pages to set page restrictions in bulk rather than having to do it one by one. By selecting a parent page, you'll apply all the restrictions to that page and all of its descendants.

Follow these steps to run the built-in script:

  • Fill out Select a Space to implement the built-in script in a certain place.
    Once you select a space, Select One or More Page Trees appears.
  • Select what page trees you want to work with by selecting the checkbox next to them.

    If you do not select any checkboxes, an error appears that "No space or pages provided."
  • Pick a value for Select Permissions Level.
    • No Restrictions (Allows Everyone to View and Edit)
    • Editing Restricted (Allows Everyone to View, But Only Some People Can Edit)
    • Viewing and Editing Restricted (Allows Only some People to View and Edit)
      If you select the Editing Restricted or Viewing and Editing Restricted value, two more values appear Groups and Users. Adding specifics groups and users to these fields enforces the restrictions only to those groups/users.

Select Run.
You can select Preview instead of Run to view changes before implementing them. Once you select Run, the Results of the script appear.

When you select *Run*, restrictions are applied to the selected page and all ancestors of this page. However, this feature does not override the Confluence permission hierarchy. If you change the permission of a page or set of pages, the restrictions of an ancestor of the page with a higher level of restrictions are observed.

Read more about page restrictions in the Confluence Page Restrictions documentation.

Example Scenario

  • The page "Banana" has a child page "Tiny Banana".
  • The "Banana" page has the restriction level of Viewing and Editing Restricted applied to a user Bob.
  • The "Tiny Banana" page has No Restrictions applied using this built-in script.

Result: The user Bob can't view the "Tiny Banana" page because the "Tiny Banana" page has inherited the Viewing and Editing Restricted" level of "Banana."