Set up a GitHub Repository

In this tutorial, you will learn how to create a GitHub repository and do the basic setup.

This tutorial was tested for ArcGIS Enterprise 11.5 in December, 2025.

Prerequisites

Check the preconditions for this tutorial:

  • VS Code is installed on your local machine.

  • You have a GitHub account.

  • You have administrative privileges to security.manager NEXT.

Create a new repository

Create a new GitHub repository for these tutorials.

  1. Log in to GitHub with your account credentials.

  2. Click the + icon in the top right corner and select New repository.

  3. Name your repository security-manager-policies.

  4. Add a description: Policy configurations for security.manager NEXT.

  5. Choose Private for sensitive policy configurations.

  6. Check Add a README file.

  7. Click Create repository.

  8. Copy the repository URL (HTTPS format).

Clone the repository in VS Code

Next, you need a local clone of that repository.

  1. Open VS Code on your local machine.

  2. Press Ctrl+Shift+P to open the Command Palette.

  3. Type Git: Clone and select it.

  4. Paste the repository URL you copied previously.

  5. Choose a local folder for the repository.

  6. When prompted, select Open to open the cloned repository.

Create the policy directory structure

security.manager NEXT CLI requires a fixed folder structure.

  1. To separate the files for security.manager NEXT from other files, create a folder policies.

    1. In VS Code Explorer, right-click in the repository root.

    2. Select New Folder.

    3. Enter the name policies.

    This folder is the working directory of security.manager NEXT.

  2. To meet the required folder structure, create a subfolder named services inside policies.

Your directory structure should look like:

security-manager-policies/
├── README.md
└── policies/
    └── services/

Add the policies

Currently, your local setup does not have policies. Create a new policy for the SampleWorldCities service.

  1. Add a new file to the services folder named SampleWorldCities.json.

  2. Open the file and add the policy from the previous tutorial.

{
    "fallbackPolicies": [{
        "layers": [
            "0"
        ],
        "restrictions": ["cities_only_names", "cities_username_filter"]
    },{
        "layers": [
            "1"
        ],
        "restrictions": ["country_username_filter"]
    }],
    "restrictions": {
        "country_username_filter": {
            "type": "spatial",
            "featuretypeurl": "https://services.conterra.de/server/rest/services/security_demos/World_Countries/FeatureServer/0",
            "featurequery": "NAME LIKE UPPER(SUBSTRING('${user.username}', 1, 1)) || '%'",
            "imageoperation": "arcgis-clipping"
        },
        "cities_username_filter":{
            "type": "feature",
            "query": "CITY_NAME LIKE UPPER(SUBSTRING('${user.username}', 1, 1)) || '%'"
        },
        "cities_only_names":{
            "type": "field",
            "allowedfields": [
                "CITY_NAME"
            ]
        }
    }
}

Backup policies from an ArcGIS Server

If you set up this project after working with the security.manager Admin UI, you may want to get all policies of the ArcGIS Server. To avoid manually copying all policies, you can use the security.manager CLI to get all the files. Be aware that the command overwrites your local files with the same name.

Install security.manager CLI and follow the guide Define and sync but use the --reverse flag in step 3 to synchronize from the ArcGIS Server to your local machine. This option is explained in Backup policies.

Summary

In this tutorial you learned to create a GitHub repository to store the policy configuration. You can collaborate with others and use the version control.

Follow JSON schema to activate autocompletion and use VS Code IntelliSense.