set-restrictions macro

Overview

The {set-restrictions} macro is similar to the {add-restriction} macro in that it sets either View or Edit permissions. However, before doing so, it removes any existing permissions of that type.

Where to use it?

Optional.

One or more {set-restrictions} macros can be put in a {trigger} macro.

Restrictions don't give users permissions to content, but rather limit who have those permissions.

For example, if everyone has edit/view permissions for the space and you add edit restrictions to a page for user A and user B, only user A and user B can edit the page, and everyone else just view the page.


Parameters

Parameter

Required

Default

Notes

Ver

type

(tick)


What type of permission to set?

  • view – assign the user/group view permission
  • edit – assign the user/group edit permission
4.5

Note: The permissions are set using Confluence's content-level permissions system and can thus be altered via the padlock icon.

user

(info)


One or more users to assign type permission to:

4.5

group

(info)


One or more user groups to assign type permission to:

4.5

(info) At least one user or group must be specified. Both can also be used at the same time.

(blue star) Invalid users/groups will be ignored and the macro will set the restrictions for the valid users defined (from v6.16.14+)

Example

This...

{workflow:Restrictions}
   {state:Test}
   {state}
   {trigger:pagecreated}
      {set-restrictions:type=view|user=bob}
   {trigger}
{workflow}

...is equivalent to:

{workflow:Restrictions}
   {state:Test}
   {state}
   {trigger:pagecreated}
      {remove-restriction:type=view}
      {add-restriction:type=view|user=bob}
   {trigger}
{workflow}

Using {set-restrictions} (markup on the left) may help avoid permissions errors in the interim period between clearing permissions and adding new permissions (markup on the right).


All examples

See also

External Links:

Workflow Authoring Guide: