kagarlickij
kagarlickij

Reputation: 8137

Azure DevOps API to manage security ACL of Variable Group

Is it possible to manage security ACL of Variable Group via API in Azure DevOps?

Couldn't find anything in documentation

Upvotes: 0

Views: 158

Answers (1)

Mengdi Liang
Mengdi Liang

Reputation: 19026

Is it possible to manage security ACL of Variable Group via API in Azure DevOps?

Of course sure!

In azure devops, the namespace name of Variable group is library. And the namespace id is B7E84409-6553-448A-BBB2-AF228E07CBEB.

Though we did not document this, but you can catch this by F12. Just click on Security, then you would see this in the Network. token of variable group are also listed in it.


After know the namespace id and the token (library/{project id}) of Variable group, now you could make use of this ACL management doc: Set Access Control Lists.

POST https://dev.azure.com/{organization}/_apis/accesscontrollists/{securityNamespaceId}?api-version=5.1

"value": [
    {
      "inheritPermissions": true,
      "token": "Library/{project id}",
      "acesDictionary": {
        "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1": {
          "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1",
          "allow": 31,
          "deny": 0
        }
      }
    }
]

Upvotes: 1

Related Questions