VSTS API返回具有重复名称的安全名称空间

时间:2018-04-17 21:44:52

标签: azure-devops azure-devops-rest-api

我正在使用VSTS API Security Namespace Query endpoint并且正在获取奇数数据。我注意到本周的变化,因为它破坏了我一直在努力的剧本。

  

GET:https:// siteroot .visualstudio.com / _apis / securitynamespaces / 00000000-0000-0000-0000-000000000000 /?api-version = 4.1-preview

具体来说,第二个名称空间本周开始出现,名称为“发布管理”。 (见下文)。我使用脚本来调用此端点,现在我不确定如何解析两个“发布管理”之间的问题。命名空间。

  • 这对我来说似乎是个错误。解决这个问题的最佳方法是什么?
  • 如果/直到有修复,最好的解决办法是硬编码GUID吗?

有任何想法或提示可以帮助我前进吗? 谢谢!

 {
"count": 58,
"value": [
...
...
...
{
    "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd",
    "name": "ReleaseManagement",
    "displayName": "ReleaseManagement",
    "separatorValue": "/",
    "elementLength": -1,
    "writePermission": 0,
    "readPermission": 1,
    "dataspaceCategory": "ReleaseManagement",
    "actions": [
        {
            "bit": 1,
            "name": "ViewTaskEditor",
            "displayName": "View task editor",
            "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd"
        },
        {
            "bit": 2,
            "name": "ViewCDWorkflowEditor",
            "displayName": "View CD work flow editor",
            "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd"
        },
        {
            "bit": 4,
            "name": "ExportReleaseDefinition",
            "displayName": "Export release definition",
            "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd"
        },
        {
            "bit": 8,
            "name": "ViewLegacyUI",
            "displayName": "View legacy UI",
            "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd"
        },
        {
            "bit": 16,
            "name": "DeploymentSummaryAcrossProjects",
            "displayName": "Deployment summary across projects",
            "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd"
        },
        {
            "bit": 32,
            "name": "ViewExternalArtifactCommitsAndWorkItems",
            "displayName": "View external artifact commits and work items",
            "namespaceId": "7c7d32f7-0e86-4cd6-892e-b35dbba870bd"
        }
    ],
    "structureValue": 1,
    "extensionType": null,
    "isRemotable": false,
    "useTokenTranslator": false,
    "systemBitMask": 0
},
{
    "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de",
    "name": "ReleaseManagement",
    "displayName": "ReleaseManagement",
    "separatorValue": "/",
    "elementLength": -1,
    "writePermission": 512,
    "readPermission": 0,
    "dataspaceCategory": "ReleaseManagement",
    "actions": [
        {
            "bit": 1,
            "name": "ViewReleaseDefinition",
            "displayName": "View release definition",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 2,
            "name": "EditReleaseDefinition",
            "displayName": "Edit release definition",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 4,
            "name": "DeleteReleaseDefinition",
            "displayName": "Delete release definition",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 8,
            "name": "ManageReleaseApprovers",
            "displayName": "Manage release approvers",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 16,
            "name": "ManageReleases",
            "displayName": "Manage releases",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 32,
            "name": "ViewReleases",
            "displayName": "View releases",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 64,
            "name": "CreateReleases",
            "displayName": "Create releases",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 128,
            "name": "EditReleaseEnvironment",
            "displayName": "Edit release environment",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 256,
            "name": "DeleteReleaseEnvironment",
            "displayName": "Delete release environment",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 512,
            "name": "AdministerReleasePermissions",
            "displayName": "Administer release permissions",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 1024,
            "name": "DeleteReleases",
            "displayName": "Delete releases",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 2048,
            "name": "ManageDeployments",
            "displayName": "Manage deployments",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        },
        {
            "bit": 4096,
            "name": "ManageReleaseSettings",
            "displayName": "Manage release settings",
            "namespaceId": "c788c23e-1b46-4162-8f5e-d7585343b5de"
        }
    ],
    "structureValue": 1,
    "extensionType": null,
    "isRemotable": false,
    "useTokenTranslator": false,
    "systemBitMask": 0
},
...
}

1 个答案:

答案 0 :(得分:0)

两个安全名称空间ReleaseManagement存在,具有不同的读/写权限和不同的操作。

例如,对于第一个ReleaseManagement安全命名空间(7c7d32f7-0e86-4cd6-892e-b35dbba870bd),它包含操作View task editorView CD work flow editorExport release definitionView legacy UI对于第二个ReleaseManagement安全命名空间(c788c23e-1b46-4162-8f5e-d7585343b5de),它包含View release definitionEdit release definitionDelete release definition等操作。

因此,您可以通过读/写权限或操作来解析两个安全名称空间ReleaseManagement