Reputation: 73
Using Azure REST API on Repository Security policies, how to get values that got assigned for
Bypass policies when completing pull requests and
Bypass policies when pushing
As on audit we need to regularly check the above Azure Repo Policies, can anyone share the related API for this ?
Upvotes: 0
Views: 189
Reputation: 179
You could use this API:
POST https://dev.azure.com/{OrgName}/_apis/Contribution/HierarchyQuery?api-version=6.0-preview
Request body:
{
"contributionIds":[
"ms.vss-admin-web.security-view-permissions-data-provider"
],
"dataProviderContext":{
"properties":{
"subjectDescriptor":
"You could get from the network trace",
"permissionSetId":"You could get from the network trace",
"permissionSetToken":"You could get from the network trace",
"accountName":"[ProjectName]\\GroupName",
"sourcePage":{
"routeId":"ms.vss-admin-web.project-admin-hub-route",
"routeValues":{
"project":"ProjectName",
"serviceHost":"OrgName"}
}
}
}
}
Please replace the certain value with your own information.
Here's a screenshot showing where to find the value of "subjectDescriptor", "permissionSetId"and "permissionSetToken":
Here's a sample response you will get:
Upvotes: 0