列出 roleDefinitions

命名空间:microsoft.graph

获取提供程序的 unifiedRoleDefinition 对象列表。

当前支持以下 RBAC 提供程序:

  • 目录 (Microsoft Entra ID)
  • 权利管理 (Microsoft Entra 权利管理)

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

要调用此 API,需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限

对于目录 (Microsoft Entra ID) 提供程序

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) RoleManagement.Read.Directory、Directory.Read.All、RoleManagement.ReadWrite.Directory、Directory.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 RoleManagement.Read.Directory、Directory.Read.All、RoleManagement.ReadWrite.Directory、Directory.ReadWrite.All

重要

在具有工作或学校帐户的委托方案中,必须为登录用户分配受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。 此操作支持以下最低特权角色:

  • 目录读取器
  • 全局读取者
  • 特权角色管理员

对于权利管理提供程序

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) EntitlementManagement.Read.All、EntitlementManagement.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 EntitlementManagement.Read.All、EntitlementManagement.ReadWrite.All

HTTP 请求

列出目录提供程序的角色定义:

GET /roleManagement/directory/roleDefinitions

列出权利管理提供程序的角色定义:

GET /roleManagement/entitlementManagement/roleDefinitions

可选的查询参数

此方法支持 $filter (eqin 运算符,) 、 和 isBuiltIn 属性上的 displayNameidOData 查询参数。 它还支持 $expand 关系。 若要了解一般信息,请参阅 OData 查询参数

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法在响应正文中返回响应 200 OK 代码和 unifiedRoleDefinition 对象的集合。

示例

示例 1:检索目录提供程序的角色定义

请求

GET https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#roleManagement/directory/roleDefinitions",
    "value": [
        {
            "id": "729827e3-9c14-49f7-bb1b-9608f156bbb8",
            "description": "Can reset passwords for non-administrators and Helpdesk Administrators.",
            "displayName": "Helpdesk Administrator",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "729827e3-9c14-49f7-bb1b-9608f156bbb8",
            "version": "1",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.directory/users/invalidateAllRefreshTokens",
                        "microsoft.directory/users/bitLockerRecoveryKeys/read",
                        "microsoft.directory/users/password/update",
                        "microsoft.azure.serviceHealth/allEntities/allTasks",
                        "microsoft.azure.supportTickets/allEntities/allTasks",
                        "microsoft.office365.webPortal/allEntities/standard/read",
                        "microsoft.office365.serviceHealth/allEntities/allTasks",
                        "microsoft.office365.supportTickets/allEntities/allTasks"
                    ],
                    "condition": null
                }
            ],
            "inheritsPermissionsFrom": [
                {
                    "id": "88d8e3e3-8f55-4a1e-953a-9b9898b8876b"
                }
            ]
        },
        {
            "id": "f023fd81-a637-4b56-95fd-791ac0226033",
            "description": "Can read service health information and manage support tickets.",
            "displayName": "Service Support Administrator",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "f023fd81-a637-4b56-95fd-791ac0226033",
            "version": "1",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.azure.serviceHealth/allEntities/allTasks",
                        "microsoft.azure.supportTickets/allEntities/allTasks",
                        "microsoft.office365.webPortal/allEntities/standard/read",
                        "microsoft.office365.serviceHealth/allEntities/allTasks",
                        "microsoft.office365.supportTickets/allEntities/allTasks"
                    ],
                    "condition": null
                }
            ],
            "inheritsPermissionsFrom": [
                {
                    "id": "88d8e3e3-8f55-4a1e-953a-9b9898b8876b"
                }
            ]
        },
        {
            "id": "b0f54661-2d74-4c50-afa3-1ec803f12efe",
            "description": "Can perform common billing related tasks like updating payment information.",
            "displayName": "Billing Administrator",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "b0f54661-2d74-4c50-afa3-1ec803f12efe",
            "version": "1",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.directory/organization/basic/update",
                        "microsoft.azure.serviceHealth/allEntities/allTasks",
                        "microsoft.azure.supportTickets/allEntities/allTasks",
                        "microsoft.commerce.billing/allEntities/allTasks",
                        "microsoft.office365.webPortal/allEntities/standard/read",
                        "microsoft.office365.serviceHealth/allEntities/allTasks",
                        "microsoft.office365.supportTickets/allEntities/allTasks"
                    ],
                    "condition": null
                }
            ],
            "inheritsPermissionsFrom": [
                {
                    "id": "88d8e3e3-8f55-4a1e-953a-9b9898b8876b"
                }
            ]
        }
    ]
}

示例 2:检索权利管理提供程序的角色定义

请求

GET https://graph.microsoft.com/v1.0/roleManagement/entitlementManagement/roleDefinitions

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#roleManagement/entitlementManagement/roleDefinitions",
    "value": [
        {
            "id": "ae79f266-94d4-4dab-b730-feca7e132178",
            "displayName": "Catalog owner",
            "description": "Catalog owner",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "ae79f266-94d4-4dab-b730-feca7e132178",
            "version": "1.0",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.entitlementManagement/allEntities/allTasks"
                    ],
                    "condition": null
                }
            ]
        },
        {
            "id": "44272f93-9762-48e8-af59-1b5351b1d6b3",
            "displayName": "Catalog reader",
            "description": "Catalog reader",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "44272f93-9762-48e8-af59-1b5351b1d6b3",
            "version": "1.0",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.entitlementManagement/allEntities/Read"
                    ],
                    "condition": null
                }
            ]
        },
        {
            "id": "7f480852-ebdc-47d4-87de-0d8498384a83",
            "displayName": "AccessPackages manager",
            "description": "AccessPackages manager",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "7f480852-ebdc-47d4-87de-0d8498384a83",
            "version": "1.0",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.entitlementManagement/AccessPackageCatalog/AccessPackage/allTasks",
                        "microsoft.entitlementManagement/AccessPackageCatalog/allEntities/Read"
                    ],
                    "condition": null
                }
            ]
        },
        {
            "id": "ba92d953-d8e0-4e39-a797-0cbedb0a89e8",
            "displayName": "Catalog creator",
            "description": "Catalog creator",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "ba92d953-d8e0-4e39-a797-0cbedb0a89e8",
            "version": "1.0",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.entitlementManagement/AccessPackageCatalog/Create"
                    ],
                    "condition": null
                }
            ]
        },
        {
            "id": "e2182095-804a-4656-ae11-64734e9b7ae5",
            "displayName": "AccessPackage assignment manager",
            "description": "AccessPackage assignment manager",
            "isBuiltIn": true,
            "isEnabled": true,
            "templateId": "e2182095-804a-4656-ae11-64734e9b7ae5",
            "version": "1.0",
            "rolePermissions": [
                {
                    "allowedResourceActions": [
                        "microsoft.entitlementManagement/AccessPackageCatalog/AccessPackage/GrantRequests/allTasks",
                        "microsoft.entitlementManagement/AccessPackageCatalog/AccessPackage/Grants/allTasks",
                        "microsoft.entitlementManagement/AccessPackageCatalog/allEntities/Read"
                    ],
                    "condition": null
                }
            ]
        }
    ]
}