---
title: "set-restrictions macro"
canonical: "https://support.appfire.com/space/CDML/649662496/set-restrictions%20macro"
format: markdown
---
> Macro (aura-html)


## Overview

> Macro (excerpt)
> 
> Reset content view/edit restrictions

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](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133).

## Parameters

| **Parameter** | **Required** | **Default** | **Notes** | **Ver** |
| --- | --- | --- | --- | --- |
| `type` | :check_mark: |  | What type of permission to set?<br>- `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` | :info: |  | One or more users to assign `type` permission to:<br>- comma-separated list of usernames
- supports [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | 4.5 |
| `group` | :info: |  | One or more user groups to assign `type` permission to:<br>- comma-separated list of user groups
- supports [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302) | 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

> 📝 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.

> 📝 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

> Macro (contentbylabel)

## See also

- [Atlassian Confluence page restrictions](https://confluence.atlassian.com/doc/page-restrictions-139414.html)

[Workflow Authoring Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648611901)

- [Conditions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694110)
- [Roles and Permissions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650217543)
- [Value References](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694302)
- [add-restriction macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649793069)
- [remove-restriction macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649957267)