> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the advanced editor

> This topic explains how to access and use the advanced editor to create complex roles and policies. The advanced editor is a tool for experienced LaunchDarkly members who want to create their own roles.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

## Overview

This topic explains how to access and use the advanced editor to create complex roles and policies. The advanced editor is a tool for experienced LaunchDarkly members who want to create their own roles. You can use it to create roles and policies that are more complex and detailed than those supported by the policy builder.

<Note title="The advanced editor is powerful">
  The advanced editor can cause large permissions changes to sensitive or confidential resources. If you use the advanced editor incorrectly, it is possible to create a role that disables your LaunchDarkly project, locks yourself out of your account, or causes other irrevocable changes.

  It is critically important that you read all the documentation in the [Member role concepts](/home/account/roles/role-concepts) section thoroughly before you use the advanced editor to create or modify any roles.

  To learn more, read [Member role concepts](/home/account/roles/role-concepts).
</Note>

## Create role policies with the advanced editor

To access the advanced editor:

1. Click the **gear** icon in the left sidenav to view Organization settings.

2. Click **Roles** in the left sidenav.

3. Click **Create role**. The New role page appears:

<Frame caption="The New role page.">
  ![The New role page.](https://files.buildwithfern.com/https://launchdarkly.docs.buildwithfern.com/docs/44612cf6a5e90400a4cdc7b62bb89e5d476a240f31d6b34a3eac7df52c45a233/assets/images/auto/custom-roles-new-role.auto.png)
</Frame>

4. In the "Edit Policy" panel, click **View JSON**.

5. (Optional) If you do not wish to use the advanced editor, click **Policy builder** to return to the graphical policy builder. Continue with the procedure [Create policies for roles](/home/account/roles/role-create#create-policies-for-roles).

6. Specify the effects, resources, and actions you wish. You can also specify inverse action and resource sets using `notActions` and `notResources` respectively.

7. Click **Create role**.

## Syntax for the advanced editor

When you create a policy with the advanced editor, you use a JSON array to specify the policy. Each element in the policy array is a statement represented as a JSON object with three attributes:

\| Attribute name

| Description |
| - |

\| --- |
\| <code>effect</code>

\| <code>allow</code> or <code>deny</code> . |
\| <code>actions / notActions</code>

\| A list of action specifiers defining the actions to which the statement applies or does not apply. To review the available action specifiers, read [Using actions](/home/account/roles/role-actions) . |
\| <code>resources / notResources</code>

\| A list of resource specifiers defining the resources to which the statement applies or does not apply. To review the available resource specifiers, read [About resource types and scopes](/home/account/roles/role-resources#about-resource-types-and-scopes) . |

When you create a policy with the advanced editor, you can specify resources that the role can or cannot access in the following ways:

* All instances of the resource, for example, all projects:

<CodeGroup>
  ```json title="All actions on all projects" theme={null}
          [
            {
              "effect": "allow",
              "actions": ["*"],
              "resources": [ "proj/*"]
            }
          ]
  ```
</CodeGroup>

* All instances of the resource with a few exceptions, for example, all projects except "Project A":

<CodeGroup>
  ```json title="All actions on all projects except Project A" theme={null}
          [
            {
              "effect": "allow",
              "actions": ["*"],
              "notResources": [ "proj/project-a"]
            }
          ]
  ```
</CodeGroup>

* Only specific instances of the resource, for example, "Project A," "Project B," and "Project C":

<CodeGroup>
  ```json title="All actions on Project A, Project B, Project C" theme={null}
          [
            {
              "effect": "allow",
              "actions": ["*"],
              "resources": [ "proj/project-a", "proj/project-b", "proj/project-c"]
            }
          ]
  ```
</CodeGroup>

* Only specific instances of the resource, where the instances are specified based on a parameter, called a [role attribute](/home/getting-started/vocabulary#role-attribute). You specify the value of this parameter when you assign the role to a member or team. For example, all projects whose project key will be specified by the parameter `developerProjectKey`:

<CodeGroup>
  ```json title="All actions on project specified in developerProjectKey" theme={null}
          [
            {
              "effect": "allow",
              "actions": ["*"],
              "resources": ["proj/${roleAttribute/developerProjectKey}"]
            }
          ]
  ```
</CodeGroup>

* Only specific instances of the resource, where the instances have a particular tag. For example, all projects with the "example" tag:

<CodeGroup>
  ```json title="All actions on projects with tag 'example'" theme={null}
          [
            {
              "effect": "allow",
              "actions": ["*"],
              "resources": [ "proj/*;example"]
            }
          ]
  ```
</CodeGroup>

* Only specific instances of the resource, where the instance properties match a particular value, for example, all environments that are marked as [critical](/home/account/environment#critical-environments):

<CodeGroup>
  ```json title="All actions on critical environments" theme={null}
          [
            {
              "effect": "allow",
              "actions": ["*"],
              "resources": [ "proj/*:env/*;{critical:true}"]
            }
          ]
  ```
</CodeGroup>

In the advanced editor, you must use resource keys, not display names. If you use names, the policies will not take effect. The resource keys are case-sensitive. For example, if the production environment of your default project has the key `production`, then referencing `proj/default:env/Production` in your policy will not work. Alternatively, you can use role attributes instead of specific resource keys in your policy. To learn more, read [Using role scope](/home/account/roles/role-scope).

For advanced policy examples, read [Example roles and policies](/home/account/roles/example-roles).
