Skip to end of banner
Go to start of banner

How to create pages from template pages - self service

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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. 

Delegating

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

Confluence Download only

Example - user dialog to create a standard personal space



Source for copy/paste convenience

CLI 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@ 

 

 

  • No labels