# Set Directory Permissions

> Adds permissions for a specified user or group to a directory with a specified inheritance type.

Source: https://docs.capaone.com/capaone/application-manager/powerbricks/set-directory-permissions/  
Product: CapaOne — a separate CapaSystems product; do not apply this page to any other.

Adds permissions for a specified user or group to a directory with a specified inheritance type.

## Parameters

#### Directory path
*Required*

The full path of the directory - ex. C:\Program Files\Common Files

#### User or group
*Required*

The user or group to add permissions for - ex. Domain\User or $env:COMPUTERNAME\LocalGroupName or S-1-5-32-544 or BUILTIN\Users. Please add only one user or group.

#### Permission
*Required* — Default: `Full Control`

The permission to add Allowed values: `Full Control`, `Modify`, `Read`, `Read And Execute`, `Execute File`, `Write`, `Delete`.

#### Inheritance type
*Optional* — Default: `This folder, sub-folders and files`

The inheritance type to use Allowed values: `This folder only`, `This folder, sub-folders and files`, `This folder and sub-folders`, `This folder and files`, `Sub-folders and files only`, `Sub-folders only`, `Files only`.

#### Require Directory To Exist
*Optional* — Default: `True`

Enable to stop with an error when the directory does not exist. Disable only if the directory is expected to be missing on some machines.

## Details

- **Category:** Permissions
- **Brick ID:** `Directory-Add-Permission`

## Raw JSON definition

**JSON**

```json
{
  "category": "permissions",
  "description": "Adds permissions for a specified user or group to a directory with a specified inheritance type.",
  "developerVendor": "CapaSystems A/S",
  "displayName": null,
  "id": "Directory-Add-Permission",
  "name": "Set Directory Permissions",
  "parameters": [
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "The full path of the directory - ex. C:\\Program Files\\Common Files",
      "id": "Path",
      "name": "Directory path",
      "regExValidation": "",
      "required": true,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": null,
      "description": "The user or group to add permissions for - ex. Domain\\User or $env:COMPUTERNAME\\LocalGroupName or S-1-5-32-544 or BUILTIN\\Users. Please add only one user or group.",
      "id": "Identity",
      "name": "User or group",
      "regExValidation": "",
      "required": true,
      "type": "TextBox",
      "value": null,
      "values": [],
      "valuesObject": null
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": {
        "id": "FullControl",
        "name": "Full Control"
      },
      "description": "The permission to add",
      "id": "Right",
      "name": "Permission",
      "regExValidation": "",
      "required": true,
      "type": "ComboBox",
      "value": null,
      "values": [],
      "valuesObject": [
        {
          "id": "FullControl",
          "name": "Full Control"
        },
        {
          "id": "Modify",
          "name": "Modify"
        },
        {
          "id": "Read",
          "name": "Read"
        },
        {
          "id": "ReadAndExecute",
          "name": "Read And Execute"
        },
        {
          "id": "ExecuteFile",
          "name": "Execute File"
        },
        {
          "id": "Write",
          "name": "Write"
        },
        {
          "id": "Delete",
          "name": "Delete"
        }
      ]
    },
    {
      "allowManualInput": false,
      "defaultValue": "",
      "defaultValueObject": {
        "id": "1",
        "name": "This folder, sub-folders and files"
      },
      "description": "The inheritance type to use",
      "id": "InheritanceType",
      "name": "Inheritance type",
      "regExValidation": "",
      "required": false,
      "type": "ComboBox",
      "value": null,
      "values": [],
      "valuesObject": [
        {
          "id": "0",
          "name": "This folder only"
        },
        {
          "id": "1",
          "name": "This folder, sub-folders and files"
        },
        {
          "id": "2",
          "name": "This folder and sub-folders"
        },
        {
          "id": "3",
          "name": "This folder and files"
        },
        {
          "id": "4",
          "name": "Sub-folders and files only"
        },
        {
          "id": "5",
          "name": "Sub-folders only"
        },
        {
          "id": "6",
          "name": "Files only"
        }
      ]
    },
    {
      "allowManualInput": false,
      "defaultValue": "True",
      "defaultValueObject": null,
      "description": "Enable to stop with an error when the directory does not exist. Disable only if the directory is expected to be missing on some machines.",
      "id": "ShouldPathExist",
      "name": "Require Directory To Exist",
      "regExValidation": "",
      "required": false,
      "type": "Boolean",
      "value": null,
      "values": [],
      "valuesObject": null
    }
  ],
  "powershell": {
    "base64Encoded": true,
    "function": "ZnVuY3Rpb2..."
  },
  "type": "powerbrick",
  "version": "2026.9.1.1"
}
```
