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.
-
Log in to GitHub with your account credentials.
-
Click the + icon in the top right corner and select New repository.
-
Name your repository security-manager-policies.
-
Add a description: Policy configurations for security.manager NEXT.
-
Choose Private for sensitive policy configurations.
-
Check Add a README file.
-
Click Create repository.
-
Copy the repository URL (HTTPS format).
Clone the repository in VS Code
Next, you need a local clone of that repository.
-
Open VS Code on your local machine.
-
Press Ctrl+Shift+P to open the Command Palette.
-
Type
Git: Cloneand select it. -
Paste the repository URL you copied previously.
-
Choose a local folder for the repository.
-
When prompted, select Open to open the cloned repository.
Create the policy directory structure
security.manager NEXT CLI requires a fixed folder structure.
-
To separate the files for security.manager NEXT from other files, create a folder policies.
-
In VS Code Explorer, right-click in the repository root.
-
Select New Folder.
-
Enter the name
policies.
This folder is the working directory of security.manager NEXT.
-
-
To meet the required folder structure, create a subfolder named
servicesinsidepolicies.
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.
-
Add a new file to the
servicesfolder namedSampleWorldCities.json. -
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.