Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

Comala Document Management for Data Center
Results will update as you type.
  • Overview
  • Get started
  • User Guide
  • Workflow Authoring Guide
    • Workflow elements and concepts
    • Macros
      • remove-label macro
      • workflow-instructions macro
      • task macro
      • document-tasks-report macro
      • send-email macro
      • set-message macro
      • remotepublish-page macro
      • remoteremove-page macro
      • approve-page macro
      • approve-children macro
      • add-comment macro
      • add-restriction macro
      • approval macro
      • description macro
      • document-actions-report macro
      • document-approvals-report macro
      • document-states-report macro
      • document-stats-report macro
      • get-metadata macro
      • increment-metadata macro
      • pageactivity macro
      • pagefooter macro
      • pageheader macro
      • pagestatus macro
      • pdf-export macro
      • publish-page macro
      • read-ack macro
      • reject-children macro
      • reject-page macro
      • remove-restriction macro
      • send-slack-user macro
      • set-label macro
      • set-metadata macro
      • set-restrictions macro
      • set-state-expiry macro
      • set-state macro
      • snapshot-page macro
      • state macro
      • state-selection macro
      • workflowparameter macro
      • workflow-report macro
      • trigger macro
      • Conditions, Content and Value References
      • complete-task macro
      • Deprecated macros
      • workflow macro
      • Reserved characters
    • Using workflow builder
  • How to's and tutorials
  • Reporting Guide
  • Administration Guides
  • Developer Guides
  • Integration Guides
  • Migrating to Confluence Cloud
  • Release notes
  • Support
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    set-restrictions macro
    Updated May 08, 2024

    set-restrictions macro

    1 Where to use it? | 2 Parameters | 3 Example | 4 All examples | 5 See also

    Overview

    The set-restrictions macro is similar to the add-restriction macro in setting Confluence View or Edit permissions to named users. However, before doing so, it removes any existing permissions of that type.

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

    For example, if everyone has edit/view permissions for the space, adding edit restrictions to a page for two users - user A and user B - means that only these two users - user A and user B - can edit the page. Everyone else can view the page.

    Where to use it?

    Optional.

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

    Parameters

    Parameter

    Required

    Default

    Notes

    Ver

    Parameter

    Required

    Default

    Notes

    Ver

    type



    What type of permission to set?

    • view – assign the user/group view permission

    • edit – assign the user/group edit permission

    4.5

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

    user



    One or more users to assign type permission to:

    • comma-separated list of usernames

    • supports Value References

    4.5

    group



    One or more user groups to assign type permission to:

    • comma-separated list of user groups

    • supports Value References

    4.5

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

     Invalid users/groups are ignored and the macro sets the restrictions for the valid users defined (from v6.16.14+).

    Example

    This is for a new page ...

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

     

    ... and is equivalent to:

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

    This is for a new blog post ...

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

     

    ... and is equivalent to:

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

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

    If using a workflow for blog posts and pages, add both triggers to add the view restriction on creating a blog post or a page.

    {workflow:Restrictions} {state:Draft|approved=Approved} {approval:Review|assignable=true} {state} {state:Approved|final=true|updated=Draft} {state} {trigger:newscreated} {set-restrictions:type=view|user=bob} {trigger} {trigger:pagecreated} {set-restrictions:type=view|user=bob} {trigger} {trigger:newsapproved} {remove-restriction|type=view} {trigger} {trigger:pageapproved} {remove-restriction|type=view} {trigger} {trigger:statechanged|state=Draft} {set-restrictions:type=view|user=bob} {trigger} {workflow}

     

    These examples use the newscreated and pagecreated events to limit the page-level permissions. They only work when the workflow is a space workflow and the workflow is enabled in the space at the time the page or blog post is created.

    All examples

    • Page:
      Add, remove and set page restrictions using a workflow trigger
    • Page:
      Require Parameters on a state transition — Require workflow parameter values to be set before moving into a workflow state.
    • Page:
      Restricting drafts to specific users using the add-restriction macro

    See also

    • Atlassian Confluence page restrictions

    Workflow Authoring Guide

    • Conditions

    • Roles and Permissions

    • Value References

    • add-restriction macro

    • remove-restriction macro

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 14, "requestCorrelationId": "90d12cd8f06d49188141108ea7cc29b9"}