Using Macro Security with the Live Template Macro

The live-template macro (part of the ServiceRocket's Scaffolding Add-on) provides powerful capabilities for Site Administrators and Space Administrators to provide template-based content, as it allows the content of a page template to be rendered within a page.

This has powerful benefits from a Macro Security perspective.

  • Space-specific templates (created by Site Administrators or Space Administrators) or Global templates (created by Site Administrators) can include macros whose use is restricted by Macro Security, thereby controlling both the macro and its parameters.
  • Users of those templates can control the parameters for those templates, without gaining access to the macros or macro parameters used by those templates.
  • This alleviates the need for Administrators to secure pages using those templates through the use of "edit" page restrictions.

This is an ideal mechanism for providing and controlling restricted macros within less restricted pages.

Example Syntax

In the Macro Security properties file that governs its configuration, a statement similar to the following would be used.

In the above example:

sql-queryindicates it is defining the Macro Security to be associated with the SQL Query macro
&live-templateindicates to invoke the Live template security support
.datasource.qaDSindicates that it is referring to the Parameter Restriction for the "datasource" parameter, and applies only to the datasource named "qaDS"
*globalindicates the restriction applies to all global templates
space:QAindicates the restriction also applies to the space templates defined within the space having a spaceKey = "QA"