Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column

Description

This is the same scenario as How to create pages from template pages, but uses the Run CLI Actions in Confluence to make is significantly easier to manage and potentially delegate to non-admin users. 

Tip
titleDelegating

Using the Run Self-Service Reports for Confluence and CMSP, a user form can be created to allow non-administrators to run the actions to create pages.

Info

Confluence Download only

Excerpt
hiddentrue

Using the CLI to create a standard set of pages

...

with delegation to non-administrators

Column
width70%

Image Added

Example - user dialog to create a standard personal space


Image Added

Source for copy/paste convenience

No Format
titleCLI macro body
--action run --continue --findReplace "@userId@:$user,@managerId@:$manager"
 
@DATA:
--action addSpace --userId @userId@

# add admin permission for the user to their own space
--action addpermissions --space "~@userId@" --permissions "SETSPACEPERMISSIONS" --userId @userId@

# add space permissions to allow general user access to personal space
--action addPermissions --space "~@userId@" --group confluence-users --permissions "VIEWSPACE, COMMENT"

# add space permissions to all manager more access
--action addPermissions --space "~@userId@" --userId @managerId@ --permissions "VIEWSPACE, EDITSPACE, EXPORTPAGE, SETPAGEPERMISSIONS, REMOVEPAGE, COMMENT, REMOVECOMMENT, CREATEATTACHMENT, REMOVEATTACHMENT, EXPORTSPACE"

# add pages by copying template pages
--action copyPage --space templateSpace --title @home           --newSpace "~@userId@" --descendents --replace --noConvert
--action copyPage --space templateSpace --title "Public stuff"  --newSpace "~@userId@" --descendents --parent @home --replace --noConvert
--action copyPage --space templateSpace --title "Private stuff" --newSpace "~@userId@" --descendents --parent @home --replace --noConvert
--action copyPage --space templateSpace --title "Manager stuff" --newSpace "~@userId@" --descendents --parent @home --replace --noConvert

# add page permission to protect private section
--action addPermissions --space "~@userId@" --title "Private stuff" --permissions "view, edit" --userId @userId@

# add page permission to protect manager section
--action addPermissions --space "~@userId@" --title "Manager stuff" --permissions "view" --userId @userId@
--action addPermissions --space "~@userId@" --title "Manager stuff" --permissions "view, edit" --userId @managerId@